public static void OnModified(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpeakerSmall sender = (SpeakerSmall)d; if (sender.SpeakerModified != null) { sender.SpeakerModified(); } }
private void SpeakerSmall_Drop(object sender, DragEventArgs e) { if (sender != null && e.AllowedEffects.HasFlag(DragDropEffects.Copy) && e.Data.GetData(typeof(SpeakerContainer)) != null) { SpeakerSmall ss = (sender as UIElement).VisualFindChild <SpeakerSmall>(); e.Effects = DragDropEffects.Copy; SpeakerContainer cont = (SpeakerContainer)e.Data.GetData(typeof(SpeakerContainer)); (ss.DataContext as SpeakerPair).Speaker2 = cont; e.Handled = true; } }
public static void OnSpeakerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpeakerSmall sender = (SpeakerSmall)d; BindingOperations.SetBinding(sender, LoadingProperty, new Binding("IsLoading") { Source = sender.SpeakerContainer }); BindingOperations.SetBinding(sender, ModifiedProperty, new Binding("Changed") { Source = sender.SpeakerContainer, Mode = BindingMode.OneWay }); }
public static void OnLoadingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpeakerSmall sender = (SpeakerSmall)d; }