public GroupDevice(StreetLightBindingDataGroup group ) { InitializeComponent(); this.DataContext = bindingDataGroup =group;// this.GroupInfo = GroupInfo; group.PropertyChanged+=GroupDevice_PropertyChanged; }
private void Button_Click_1(object sender, RoutedEventArgs e) { System.Collections.Generic.List<StreetLightBindingData> list = new List<StreetLightBindingData>(); foreach (UIElement element in this.LayoutRoot.Children) { if (element is LedButton) { LedButton btn = element as LedButton; if (btn.IsChecked) { StreetLightBindingData data = (element as LedButton).DataContext as StreetLightBindingData; list.Add(data); } } } if (list.Count == 0) return; StreetLightBindingDataGroup group = new StreetLightBindingDataGroup() { DimLevel = 20, BindingDatas = list.ToArray() }; this.tmr.Stop(); this.NavigationService.Navigate(new GroupDevice(group)); }