Sunday, September 28, 2014

Customize PickerFlyoutBase command bar

Hi Alvaro,


I find PickerFlyoutBase class is supported in windows phone 8.1 runtime app only, so I assume you are asking windows phone 8.1 runtime app question.


Microsoft provides some implementations inherited on PickerFlyoutBase class, such as ListPickerFlyout , DatePickerLayout , TimePickerFlyout . There classes provides limited properties to modify the Flyout UI. You can build a new class to inherit the base class and create your own PickerFlyout object.


An easy way to custom PickerFlyout UI is to define a Flyout in Button, write your own flyout UI in it. Close the flyout UI after the choice. Code looks like the following.



<Grid>

<StackPanel>

<Button Content="hello">

<Button.Flyout>

<Flyout x:Name="flyout1">

<StackPanel>

<TextBlock Text="Make your choice?"></TextBlock>

<Button Content="Yes" Click="Button_Click"></Button>

<Button Content="No" Click="Button_Click_1"></Button>

<Button Content="I don't know" Click="Button_Click_2"></Button>

</StackPanel>

</Flyout>



</Button.Flyout>

</Button>

<TextBlock x:Name="msg"></TextBlock>

</StackPanel>

</Grid>







private void Button_Click(object sender, RoutedEventArgs e)

{

msg.Text = "you click the yes button";

flyout1.Hide();



}

If I misunderstand you, please feel free to let me know.


Regards,




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


No comments:

Post a Comment