private static void OnSizeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { if (e.NewValue != null) { LaunchpadPro pro = obj as LaunchpadPro; pro.SetSize((double)e.NewValue); } }
private static void OnIsMembraneChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { if (e.NewValue != null && e.OldValue != e.NewValue) { LaunchpadPro pro = obj as LaunchpadPro; pro.ShowOrHideMembrane(); } }
private static void OnDataChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { if (e.NewValue != null) { LaunchpadPro pro = obj as LaunchpadPro; List <Light> mListList = e.NewValue as List <Light>; pro.onDataChange?.Invoke(mListList); pro.ClearAllColorExcept(); for (int i = 0; i < mListList.Count; i++) { if (mListList[i].Action == 128 || mListList[i].Color < 0) { pro.SetButtonBackground(mListList[i].Position, closeBrush); } else { pro.SetButtonBackground(mListList[i].Position, brushList[mListList[i].Color]); } } } }