그래서 만든 사용자 지정 내가 사용자 정의 컨트롤의 사용했다, 그것은 재사용하기 위해, UWP에 대화 상자가 나타재사용 가능한 사용자 지정 팝업 대화를 만들려면
<UserControl
x:Class="ContentDialogueBox.PopUpCustomDialogueUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ContentDialogueBox"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<ContentDialog x:Name="MyContentDialogCustom"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Title="Lorem Ipsum"
PrimaryButtonText="OKxxx"
SecondaryButtonText="Canc"
Margin="0,0,-98,0" Width="1000" >
<Grid Background="Wheat">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="Name" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox PlaceholderText="First Name" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="10"/>
<TextBlock Text="Middle Name" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1"/>
<TextBox PlaceholderText="Middle Name" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="10"/>
<TextBlock Grid.Row="2" Text="Name" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox PlaceholderText="First Name" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="10"/>
</Grid>
</ContentDialog>
</UserControl>
난을 참조 할 수 있었다 ButtonShowContentDialog4라는 버튼이 포함 된 다른 페이지의 사용자 컨트롤, 내가 달성하고자하는 것은 페이지의 버튼을 클릭 할 때 PopUp 대화 상자를 표시하는 것입니다. 제발 어떻게 이것을 달성합니까.
private void ButtonShowContentDialog4_Click(object sender, RoutedEventArgs e)
{
//show the PopUp here when this button is clicked
}
, 팝 업이었다
는 그런 다음 코드에서의 메서드를 호출 할 수 있습니다 화면에 보이지 않습니다. –
@OsamuyimenOsagiedeDennis 내가 한 일을 잘 모르겠지만 코드를 복사하여 붙여 넣으면 위에서와 같이 작동하는 것 같습니다. – Romasz
오케이, 제대로 점검하고 피드백을 주겠다. 많은 시간을 내 주셔서 감사합니다. –