Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. <Grid x:Name="ContentPanelDaily"
  2. Grid.Row="1"
  3. <Grid.RowDefinitions>
  4. <RowDefinition Height="40" />
  5. </Grid.RowDefinitions>
  6. <Grid.ColumnDefinitions>
  7. <ColumnDefinition Width="60" />
  8. <ColumnDefinition Width="80" />
  9. </Grid.ColumnDefinitions>
  10.  
  11. <TextBlock Grid.Row="0"
  12. Grid.Column="0"
  13. Style="{StaticResource PhoneTextAccentStyle}"
  14. Margin="0,0,0,0">
  15. First
  16. </TextBlock>
  17. <TextBlock Grid.Row="0"
  18. Grid.Column="1"
  19. Style="{StaticResource PhoneTextAccentStyle}"
  20. Margin="0,0,0,0">
  21. Second
  22. </TextBlock>
  23. </Grid>
  24.  
  25. <Button OnClick="evetnHandler">
  26. <TextBlock Grid.Row="0"
  27. Grid.Column="0"
  28. Style="{StaticResource PhoneTextAccentStyle}"
  29. Margin="0,0,0,0">
  30. First
  31. </TextBlock>
  32. </Button>
  33.  
  34. <ListBox ItemsSource="{Binding Items}"
  35. SelectedItem="{Binding Selected, Type=TwoWay}">
  36. <ListBox.ItemTemplate>
  37. <DataTemlate>
  38. <TextBlock
  39. Style="{StaticResource PhoneTextAccentStyle}"
  40. Margin="0,0,0,0" Text="{Binding Name}"/>
  41. </DataTemplate>
  42. </ListBox.ItemTemplate>
  43. </ListBox>
  44.  
  45. public ObservableCollection<DataItem> Items {get;set;}
  46.  
  47. private DataItem _selected;
  48. public DataItem Selected
  49. {
  50. get {return _selected;}
  51. set
  52. {
  53. _selected = value;
  54. //ha! item selected!!! handle it
  55. }
  56.  
  57. }
  58.  
  59. public class DataItem
  60. {
  61. public string Name {get;set;}
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement