2013-04-08 4 views
2

제 질문은 그와 같습니다. Callisto 툴킷에서 CustomDialog 컨트롤을 어떻게 표시해야합니까? 나는 다음과 같은 XAML 있습니다Callisto WinRT 툴킷에서 사용자 정의 대화 상자를 표시하는 방법은 무엇입니까?

<controls:LayoutAwarePage 
x:Name="pageRoot" 
x:Class="HeronClientWindowsStore.Views.SuggestEventDialogPage" 
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:HeronClientWindowsStore.Views" 
xmlns:controls="using:HeronClientWindowsStore.Controls" 
xmlns:callisto="using:Callisto.Controls" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d"> 

<Page.Resources> 
</Page.Resources> 

<callisto:CustomDialog 
        x:FieldModifier="public" 
        x:Name="suggestEventDialog" 
        Width="300" Height="500" 
        Title="Suggest an Event" 
        Background="Teal" 
        BackButtonVisibility="Visible"> 
    <StackPanel> 
     <TextBlock 
        Margin="0,0,0,8" 
        Text="Suggest an event that should be added to Heron." 
        FontSize="14.6667" 
        FontWeight="SemiLight" 
        TextWrapping="Wrap" /> 
     <TextBlock 
        Margin="0,0,0,8" 
        FontSize="14.6667" 
        FontWeight="SemiLight" 
        Text="Event URL" /> 
     <callisto:WatermarkTextBox 
        HorizontalAlignment="Left" 
        Watermark="http://www.example.com" 
        Width="400" 
        Height="35" /> 
     <StackPanel 
        Margin="0,20,0,0" 
        HorizontalAlignment="Right" 
        Orientation="Horizontal"> 
      <Button Content="OK" Width="90" Margin="0,0,20,0" /> 
      <Button Content="CANCEL" Width="90" /> 
     </StackPanel> 
    </StackPanel> 
</callisto:CustomDialog> 

그것은 표시되지 않습니다와 나는 그것을 트리거 어떤 방법을 볼 수 없습니다.

+0

감사합니다. 내 대답을 upvote면 나는 행복 할 것입니다. – Xyroid

답변

3

IsOpen 속성을 사용하여 대화 상자를 열어야합니다.

여기에 나를위한 작업 코드를 붙여 넣습니다.

XAML 대답으로 마킹

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> 
    <Button Content="Show Dialog" Click="btnShowDialog_Click" /> 
    <callisto:CustomDialog 
       x:FieldModifier="public" 
       x:Name="suggestEventDialog" 
       Title="Suggest an Event" 
       Background="Teal" 
       BackButtonVisibility="Visible" 
       BackButtonClicked="suggestEventDialog_BackButtonClicked_1"> 
     <StackPanel> 
      <TextBlock 
       Margin="0,0,0,8" 
       Text="Suggest an event that should be added to Heron." 
       FontSize="14.6667" 
       FontWeight="SemiLight" 
       TextWrapping="Wrap" /> 
      <TextBlock 
       Margin="0,0,0,8" 
       FontSize="14.6667" 
       FontWeight="SemiLight" 
       Text="Event URL" /> 
      <callisto:WatermarkTextBox 
       HorizontalAlignment="Left" 
       Watermark="http://www.example.com" 
       Width="400" 
       Height="35" /> 
      <StackPanel 
       Margin="0,20,0,0" 
       HorizontalAlignment="Right" 
       Orientation="Horizontal"> 
       <Button Content="OK" Width="90" Margin="0,0,20,0" /> 
       <Button Content="CANCEL" Width="90" /> 
      </StackPanel> 
     </StackPanel> 
    </callisto:CustomDialog> 
</Grid> 

C#

private void btnShowDialog_Click(object sender, RoutedEventArgs e) 
{ 
    suggestEventDialog.IsOpen = true; 
} 

private void suggestEventDialog_BackButtonClicked_1(object sender, RoutedEventArgs e) 
{ 
    suggestEventDialog.IsOpen = false; 
}