private void ItemsControl_TargetUpdated_1(object sender, DataTransferEventArgs e)
 {
     var sw = DataContext as MenuItemSelectorViewModel;
     if (sw == null) return;
     NumeratorRow.Height = sw.IsNumeratorVisible ? _auto45 : _thin;
     //AlphaButtonsColumn.Width = sw.AlphaButtonValues != null && sw.AlphaButtonValues.Length > 0 ? _auto15 : _thin;
 }
 private void chkClose_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     if ((bool)this.chkClose.IsChecked && !(bool)this.chkManualClose.IsChecked)
     {
         this.Close();
     }
 }
 void TargetUpdated( object sender, DataTransferEventArgs e )
 {
     // Trigger a property changed callback as long as the new value equals the default value.
     object current = DependencyObject.GetValue( DependencyProperty );
     PropertyMetadata metaData = DependencyProperty.GetMetadata( DependencyObject );
     bool equals = current == null ? current == metaData.DefaultValue : current.Equals( metaData.DefaultValue );
     if ( equals )
     {
         if ( metaData.PropertyChangedCallback != null )
         {
             metaData.PropertyChangedCallback.Invoke(
                 DependencyObject,
                 new DependencyPropertyChangedEventArgs(
                     DependencyProperty,
                     current,
                     current ) );
         }
     }
     else
     {
         // Once it is no longer the default value, we know it has been changed.
         _frameworkElement.TargetUpdated -= TargetUpdated;
         NotifyOnTargetUpdated = _prevNotifyOnTargetUpdated;
     }
 }
Exemplo n.º 4
0
 private void OnComboBoxSourceUpdated(object sender, DataTransferEventArgs e)
 {
     var comboBox = sender as ComboBox;
     if (comboBox != null)
     {
         comboBox.IsDropDownOpen = true;
     }
 }
        private void WayRef_SourceUpdated(object sender, DataTransferEventArgs e)
        {

            var model = this.DataContext as DishesWayRefViewModel;
            if (model != null)
            {
                model.SavePrice2WayRef();
            }
        }
Exemplo n.º 6
0
 private async void SourcePathTextBox_SourceUpdated(object sender, DataTransferEventArgs e) {
     Debug.Assert(DataContext is ImportSettings);
     var settings = (ImportSettings)DataContext;
     SourcePathDoesNotExist.Visibility = 
         (string.IsNullOrEmpty(settings.SourcePath) || Directory.Exists(settings.SourcePath)) ?
         System.Windows.Visibility.Collapsed :
         System.Windows.Visibility.Visible;
     await settings.UpdateSourcePathAsync().HandleAllExceptions(SR.ProductName);
 }
Exemplo n.º 7
0
 private void TextBox_OnTextChanged(object sender, DataTransferEventArgs e)
 {
   if (IssueList.SelectedIndex == -1)
     return;
   var bcf = this.DataContext as BcfFile;
   if (bcf == null)
     return;
   //if (e.Key != Key.Up && e.Key != Key.Down && e.Key != Key.Left && e.Key != Key.Right)
   bcf.HasBeenSaved = false;
 }
Exemplo n.º 8
0
 private void Binding_TargetUpdated(object sender, DataTransferEventArgs e)
 {
     string txt = TestTextBox.Text;
     mbindingExpression =
         BindingOperations.GetMultiBindingExpression(e.TargetObject, e.Property);
     mbindingExpression.UpdateSource();
     
     foreach (var bind in mbindingExpression.BindingExpressions)
         bind.UpdateSource();
 }
Exemplo n.º 9
0
 private void workingItemsDataGridTargetUpdated(object sender, DataTransferEventArgs e)
 {
     todosDataGrid.UpdateLayout();
     var workingItemsDataGrid = UIHelper.FindChild<DataGrid>(todosDataGrid, "workingItemsDataGrid");
     if (workingItemsDataGrid != null)
     {
         workingItemsDataGrid.Columns[2].Width = 0;
         workingItemsDataGrid.UpdateLayout();
         workingItemsDataGrid.Columns[2].Width = new DataGridLength(1, DataGridLengthUnitType.Star);
     }
 }
Exemplo n.º 10
0
 private void Grid_Updated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     if ((sender as ListView)?.View is GridView gridview)
     {
         foreach (var column in gridview.Columns)
         {
             // Set the Width. Then clear it to cause the autosize.
             column.Width = 1;
             column.ClearValue(GridViewColumn.WidthProperty);
         }
     }
 }
Exemplo n.º 11
0
 private void line_TargetUpdated(object sender, DataTransferEventArgs e)
 {
     tb1.GetBindingExpression(TextBlock.HorizontalAlignmentProperty).UpdateTarget();
     tb1.GetBindingExpression(TextBlock.MarginProperty).UpdateTarget();
     tb2.GetBindingExpression(TextBlock.HorizontalAlignmentProperty).UpdateTarget();
     tb2.GetBindingExpression(TextBlock.MarginProperty).UpdateTarget();
     line.GetBindingExpression(Line.VisibilityProperty).UpdateTarget();
     line2.GetBindingExpression(Line.VisibilityProperty).UpdateTarget();
     line3.GetBindingExpression(Line.VisibilityProperty).UpdateTarget();
     selectionRectangle1.GetBindingExpression(Rectangle.MarginProperty).UpdateTarget();
     selectionRectangle2.GetBindingExpression(Rectangle.MarginProperty).UpdateTarget();
 }
Exemplo n.º 12
0
 private void OnTargetUpdated(object sender, DataTransferEventArgs args)
 {
     // Handle event
     var fe = sender as FrameworkElement;
     infoText.Text = "";
     infoText.Text += args.Property.Name + " property of a " + args.Property.OwnerType.Name;
     infoText.Text += " element (";
     infoText.Text += fe.Name;
     infoText.Text += ") updated...";
     infoText.Text += DateTime.Now.ToLongDateString();
     infoText.Text += " at ";
     infoText.Text += DateTime.Now.ToLongTimeString();
 }
        private void Selector_SourceUpdated(object sender, DataTransferEventArgs e)
        {
            ChooseShowTableViewModel model = this.DataContext as ChooseShowTableViewModel;
            if (model.Selector == 1)
            {
                ViewTabControl.SelectedIndex=0;
            }
            else {
                ViewTabControl.SelectedIndex = 1;
            }


        }
Exemplo n.º 14
0
        /// <remarks>
        /// To fire this event you must add in column binding: NotifyOnTargetUpdated=True
        /// </remarks>
        private static void OnControlTargetUpdated(object sender, DataTransferEventArgs e)
        {
            var listView = sender as ListView;

            var dataGrid = sender as DataGrid;
            if (listView != null && listView.View is GridView)
            {
                var gridView = listView.View as GridView;
                gridView.Columns.ForEach(x =>
                {
                    if (double.IsNaN(x.Width))
                    {
                        x.Width = x.ActualWidth;
                    }
                    x.Width = double.NaN;
                });
            }
        }
Exemplo n.º 15
0
        private void MainDataGrid_TargetUpdated(object sender, DataTransferEventArgs e)
        {
            Microsoft.Windows.Controls.DataGrid dataGrid = (Microsoft.Windows.Controls.DataGrid)sender;
            if (currentSortColumnIndex != null)
            {
                if (currentSortDirection == "Ascending")
                {
                    dataGrid.Columns[Int32.Parse(currentSortColumnIndex)].SortDirection = ListSortDirection.Ascending;
                }
                else
                {
                    dataGrid.Columns[Int32.Parse(currentSortColumnIndex)].SortDirection = ListSortDirection.Descending;
                }
            }

        }
Exemplo n.º 16
0
 private void Tb_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     this.RaiseValueChanged(sender, (PTypeDataTag)(sender as FrameworkElement).Tag);
 }
Exemplo n.º 17
0
 private void Components_Updated(object sender, DataTransferEventArgs e)
 {
     ComponentViewModel s = sender as ComponentViewModel;
     if (s != null)
     {
         _components.Add(s);
     }
 }
Exemplo n.º 18
0
 private void TextBox_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     // we need to delay this until after the text is changed
     var box = sender as TextBox;
     Validate( box );
 }
Exemplo n.º 19
0
 private void imageList_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     //MessageBox.Show("imageList_SourceUpdated event has fired");
 }
Exemplo n.º 20
0
 private void currentImage_TargetUpdated(object sender, DataTransferEventArgs e)
 {
     //MessageBox.Show("currentImage_TargetUpdated event has fired");
 }
Exemplo n.º 21
0
 private void WarningTextBlock_TargetUpdated(object sender, DataTransferEventArgs e)
 {
     adjustBorderVisibility();
 }
Exemplo n.º 22
0
 private void DescriptionText_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     if (DescriptionText.ActualHeight > 150) {
         DescriptionText.FontSize = 12;
     }
 }
 private void eddiScriptsUpdated(object sender, DataTransferEventArgs e)
 {
     updateScriptsConfiguration();
 }
Exemplo n.º 24
0
 private void PagesListBox_SourceUpdated(object sender, DataTransferEventArgs e)
 {
 }
Exemplo n.º 25
0
 private void WarningDB_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     BindingOperations.GetBindingExpressionBase(gridForside, Grid.HeightProperty).UpdateTarget();
 }
Exemplo n.º 26
0
 private void txtStopTime_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
 }
Exemplo n.º 27
0
 private void ErrorTextBlock_TargetUpdated(object sender, DataTransferEventArgs e)
 {
     adjustBorderVisibility();
     adjustCreateButtonEnabled();
 }
Exemplo n.º 28
0
 private void comboBox_Del_Vehicle_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     this.comboBox_Del_Vehicle.ItemsSource = this.mycardealer.VehicleList;
 }
Exemplo n.º 29
0
 private void WorkspaceTabs_TargetUpdated(object sender, DataTransferEventArgs e)
 {
     if (WorkspaceTabs.SelectedIndex >= 0)
         ToggleWorkspaceTabVisibility(WorkspaceTabs.SelectedIndex);
 }
 private void lbxTags_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     SomeChangeForUpdate();
 }
Exemplo n.º 31
0
        /// <summary>
        /// Handles changes in the current cell.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="DataTransferEventArgs" /> instance containing the event data.</param>
        /// <param name="changedCell">The cell that was changed.</param>
        private void CurrentCellSourceUpdated(object sender, DataTransferEventArgs e, CellRef changedCell)
        {
            // The source of the binding for the current cell was updated
            // (e.g. check box (display control) was changed or a combo box (edit control) was changed
            var value = this.GetCellValue(changedCell);

            var selectedCells = this.SelectedCells.ToArray();
            if (!selectedCells.Contains(changedCell))
            {
                // do not set other cells when changed cell is outside selection
                return;
            }

            // Set the same value in all selected cells.
            foreach (var cell in selectedCells)
            {
                if (changedCell.Equals(cell))
                {
                    // this value should already be set by the binding
                    continue;
                }

                if (this.MultiChangeInChangedColumnOnly && cell.Column != changedCell.Column)
                {
                    // do not change value in other columns when this property is set to true
                    continue;
                }

                this.TrySetCellValue(cell, value);
            }
        }
Exemplo n.º 32
0
 private void TextBoxStockDetails_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     if (listStock.SelectedIndex < 0) return;
     //MODIFIED _vo.UpdateStockItem(listStock.SelectedIndex);
     StockView.Modified = true;
 }
Exemplo n.º 33
0
 private void comboBox_del_customer_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     this.comboBox_del_customer.ItemsSource = this.mycardealer.CustomerList;
 }
Exemplo n.º 34
0
 private void Image_SourceUpdated_1(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     var img = sender as Image;
     //Show(img);
 }