private void RefreshMenuBinding() { MultiBindingExpression b = BindingOperations.GetMultiBindingExpression(_docContextMenu, ContextMenu.ItemsSourceProperty); b.UpdateTarget(); }
private void chkIndependentProperties_Unchecked(object sender, RoutedEventArgs e) { foreach (var icon in icons) { switch (eltType) { case ShapeRepresents.Node: gui.nodeIcons.BindTextDisplayProperties(icon); break; case ShapeRepresents.Arc: gui.arcIcons.BindTextDisplayProperties(icon); break; case ShapeRepresents.HyperArc: gui.hyperarcIcons.BindTextDisplayProperties(icon); break; } MultiBindingExpression mbe = BindingOperations.GetMultiBindingExpression(icon, IconShape.DisplayTextProperty); mbe.UpdateTarget(); } expTextProperties.IsExpanded = false; expTextProperties.IsExpanded = false; chkShowNodeName.IsEnabled = false; chkShowNodeLabels.IsEnabled = false; sldDistance.IsEnabled = false; sldFontSize.IsEnabled = false; sldPosition.IsEnabled = false; }
/// <summary> /// Update the text when focus is lost. /// </summary> /// <param name="e">The event arguments.</param> protected override void OnLostKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e) { MultiBindingExpression bindingExpression = BindingOperations.GetMultiBindingExpression(this, EnumTextBox.TextProperty); base.OnLostKeyboardFocus(e); // For some reason, the selection isn't getting cleared when we lose keyboard focus, so we force it here. this.SelectionLength = 0; // Make sure the display looks reflects the underlying values. bindingExpression.UpdateTarget(); }
private void PackageIconImage_ImageFailed(object sender, ExceptionRoutedEventArgs e) { var image = sender as Image; e.Handled = true; // don't repropagate the event MultiBindingExpression binding = BindingOperations.GetMultiBindingExpression(image, Image.SourceProperty); if (binding != null && binding.BindingExpressions.All((x) => x.Status != BindingStatus.Detached)) { binding.UpdateTarget(); } }
public static void UpdateTarget(this FrameworkElement element, DependencyProperty property) { BindingExpression expression = element.GetBindingExpression(property); if (expression != null) { expression.UpdateTarget( ); return; } MultiBindingExpression multiExpression = BindingOperations.GetMultiBindingExpression(element, property); if (multiExpression != null) { multiExpression.UpdateTarget( ); } }
private void Filter_PropertyChanged(object sender, PropertyChangedEventArgs e) { MultiBindingExpression genres = BindingOperations.GetMultiBindingExpression(lstGenres, ListBox.ItemsSourceProperty); genres.UpdateTarget(); MultiBindingExpression artists = BindingOperations.GetMultiBindingExpression(lstArtists, ListBox.ItemsSourceProperty); artists.UpdateTarget(); MultiBindingExpression albums = BindingOperations.GetMultiBindingExpression(lstAlbums, ListBox.ItemsSourceProperty); albums.UpdateTarget(); MultiBindingExpression songs = BindingOperations.GetMultiBindingExpression(mivSongs, MediaItemsView.MediaItemsProperty); songs.UpdateTarget(); BindingExpression summary = lblSummary.GetBindingExpression(Label.ContentProperty); summary.UpdateTarget(); }
private void Filter_PropertyChanged(object sender, PropertyChangedEventArgs e) { MultiBindingExpression genres = BindingOperations.GetMultiBindingExpression(lstGenres, ListBox.ItemsSourceProperty); genres.UpdateTarget(); MultiBindingExpression programs = BindingOperations.GetMultiBindingExpression(lstPrograms, ListBox.ItemsSourceProperty); programs.UpdateTarget(); MultiBindingExpression series = BindingOperations.GetMultiBindingExpression(lstSeries, ListBox.ItemsSourceProperty); series.UpdateTarget(); MultiBindingExpression videos = BindingOperations.GetMultiBindingExpression(mivVideos, MediaItemsView.MediaItemsProperty); videos.UpdateTarget(); BindingExpression summary = lblSummary.GetBindingExpression(Label.ContentProperty); summary.UpdateTarget(); }
/// <summary> /// Refreshes the bindings to the data grid item source /// </summary> private void RefreshItemBinding() { MultiBindingExpression mbe = BindingOperations.GetMultiBindingExpression(dgPartsToOrganise, DataGrid.ItemsSourceProperty); mbe.UpdateTarget(); }