void lbScrollMode_SelectedIndexChanged(object sender, RoutedEventArgs e) { ListBoxEdit lbScrollMode = (ListBoxEdit)sender; ScrollMode scrollMode = (ScrollMode)((ListBoxEditItem)lbScrollMode.SelectedItem).Content; ScrollingSettings.SetScrollMode(navBar.View, scrollMode); }
public static void PrepareListBox(ListBoxEdit listBox, int index) { listBox.Items.Add("None"); listBox.Items.Add("Default"); listBox.Items.Add("Hide Overlapped"); listBox.Items.Add("Justify Around Point"); listBox.Items.Add("Justify All Around Point"); listBox.SelectedIndex = index; }
private UIElement _generateView() { _lbeMain = new ListBoxEdit() { DisplayMember = "ListBoxDisplay" }; _lbeMain.MouseDoubleClick += _lbeMain_MouseDoubleClick; return(_lbeMain); }
public Capture(ListBoxEdit listBox) { this.listBox = listBox; incc = listBox.ItemsSource as INotifyCollectionChanged; if (incc != null) { incc.CollectionChanged += incc_CollectionChanged; } }
public void ClearSelected(GridControl grid, ListBoxEdit catListBox, ListBoxEdit SubCatListBox) { IsAdd = Visibility.Visible; IsUpdate = Visibility.Collapsed; bookAddRecommend = 0; grid.SelectedItem = null; catListBox.SelectedItem = null; SubCatListBox.SelectedItem = null; message = MessageHelper.Get("+"); }
//protected void PostDataToCSV(TableView tableView) //{ // var dlg = new Microsoft.Win32.SaveFileDialog(); // dlg.FileName = "ServersDataGrid"; // dlg.DefaultExt = ".xls"; // dlg.Filter = "CSV Documents (*.csv)|*.csv"; // Nullable<bool> result = dlg.ShowDialog(); // if (result == true) // { // tableView.ExportToCsv(dlg.FileName); // } // //Common.ApplicationDataSet.Instances.WriteXml(outputFile); //} //protected void PostDataToXLSX(TableView tableView) //{ // var dlg = new Microsoft.Win32.SaveFileDialog(); // dlg.FileName = "ServersDataGrid"; // dlg.DefaultExt = ".xlsx"; // dlg.Filter = "XLSX Documents (*.xlsx)|*.xlsx"; // Nullable<bool> result = dlg.ShowDialog(); // if (result == true) // { // tableView.ExportToXlsx(dlg.FileName); // } // //Common.ApplicationDataSet.Instances.WriteXml(outputFile); //} //protected void PostDataToXLS(TableView tableView) //{ // var dlg = new Microsoft.Win32.SaveFileDialog(); // dlg.FileName = "ServersDataGrid"; // dlg.DefaultExt = ".xls"; // dlg.Filter = "XLS Documents (*.xls)|*.xls"; // Nullable<bool> result = dlg.ShowDialog(); // if (result == true) // { // tableView.ExportToXls(dlg.FileName); // } // //Common.ApplicationDataSet.Instances.WriteXml(outputFile); //} private void RowTemplateComboBox_SelectionChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e) { ListBoxEdit lbe = (ListBoxEdit)sender; TableView tableView = null; GridControl gridControl = null; var vtrootUserControl = VNC.Core.Xaml.PhysicalTree.FindAncestor <UserControl>((DependencyObject)sender); if (vtrootUserControl != null) { gridControl = (GridControl)vtrootUserControl.FindName("dataGrid"); tableView = (TableView)vtrootUserControl.FindName("tableView"); } else { var vtrootWindow = VNC.Core.Xaml.PhysicalTree.FindAncestor <DXWindow>((DependencyObject)sender); gridControl = (GridControl)vtrootWindow.FindName("dataGrid"); tableView = (TableView)vtrootWindow.FindName("tableView"); } switch (lbe.SelectedItem.ToString()) { case "Tooltip": // This uses the resources from the usercontrol/window. //var tmplt = (DataTemplate)vtrootUserControl.Resources["rowTooltipDetailTemplate"]; var tmplt = (DataTemplate)Application.PrismApp.Current.Resources["rowTooltipDetailTemplate"]; //var tmplt = (DataTemplate)Application.Current.Resources["rowTooltipDetailTemplate"]; tableView.DataRowTemplate = tmplt; break; case "SelectedRowDetails": //tableView.DataRowTemplate = (DataTemplate)Resources["rowSelectedDetailTemplate"]; // This uses the Application scope resources. var tmplt1 = (DataTemplate)Application.PrismApp.Current.Resources["rowSelectedDetailTemplate"]; //var tmplt1 = (DataTemplate)Application.Current.Resources["rowSelectedDetailTemplate"]; tableView.DataRowTemplate = tmplt1; break; case "RowDetails": // This uses FindResource. var tmplt2 = (DataTemplate)vtrootUserControl.FindResource("rowDetailTemplate"); tableView.DataRowTemplate = tmplt2; break; case "None": tableView.ClearValue(DevExpress.Xpf.Grid.TableView.DataRowTemplateProperty); break; default: break; } }
void list_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ListBoxEdit listBoxEdit = (ListBoxEdit)sender; DependencyObject hitObject = listBoxEdit.InputHitTest(e.GetPosition(listBoxEdit)) as DependencyObject; FrameworkElement hitItem = LayoutHelper.FindParentObject <ListBoxEditItem>(hitObject); if (hitItem != null) { isDragStarted = true; } }
static void InitializeAnimationListBoxEdit(ListBoxEdit listBoxEdit, IEnumerable <AnimationKind> animationKinds, Type defaultAnimationType) { List <AnimationKind> allAnimationKinds = new List <AnimationKind>(); listBoxEdit.ClearValue(ListBoxEdit.SelectedIndexProperty); AnimationKind noneAnimation = GetNoneAnimation(animationKinds); allAnimationKinds.Add(noneAnimation); allAnimationKinds.AddRange(animationKinds); listBoxEdit.ItemsSource = allAnimationKinds; listBoxEdit.SelectedIndex = GetDefaultAnimationIndex(allAnimationKinds, defaultAnimationType); }
private void ListBoxEdit_SelectedIndexChanged(object sender, RoutedEventArgs e) { gridProcessInfo.ItemsSource = null; ListBoxEdit lstbox = sender as ListBoxEdit; if (lstbox.SelectedIndex == 0) { txt_name.Text = "16寸轮毂"; RsRoutingHead mRsRoutingHead = wsRSM.UseService(s => s.GetRsRoutingHeads("ROUTING_ABV = 16LG")).FirstOrDefault(); if (mRsRoutingHead != null) { getRouting(mRsRoutingHead.PKNO); RsRoutingItem mRsRoutingItem = wsRSM.UseService(s => s.GetRsRoutingItems("ROUTING_PKNO = " + mRsRoutingHead.PKNO + "")).FirstOrDefault(); if (mRsRoutingItem != null) { mRoutingItem = mRsRoutingItem; } } } if (lstbox.SelectedIndex == 1) { txt_name.Text = "17寸轮毂"; RsRoutingHead mRsRoutingHead = wsRSM.UseService(s => s.GetRsRoutingHeads("ROUTING_ABV = 17LG")).FirstOrDefault(); if (mRsRoutingHead != null) { getRouting(mRsRoutingHead.PKNO); RsRoutingItem mRsRoutingItem = wsRSM.UseService(s => s.GetRsRoutingItems("ROUTING_PKNO = " + mRsRoutingHead.PKNO + "")).FirstOrDefault(); if (mRsRoutingItem != null) { mRoutingItem = mRsRoutingItem; } } } if (lstbox.SelectedIndex == 2) { txt_name.Text = "18寸轮毂"; RsRoutingHead mRsRoutingHead = wsRSM.UseService(s => s.GetRsRoutingHeads("ROUTING_ABV = 18LG")).FirstOrDefault(); if (mRsRoutingHead != null) { getRouting(mRsRoutingHead.PKNO); RsRoutingItem mRsRoutingItem = wsRSM.UseService(s => s.GetRsRoutingItems("ROUTING_PKNO = " + mRsRoutingHead.PKNO + "")).FirstOrDefault(); if (mRsRoutingItem != null) { mRoutingItem = mRsRoutingItem; } } } }
public WindowEditParameterValues( IEnumerable<ObservableCollection<Y_NORM_MANAGEMENT_GET_PARAMETER_VALUES_Result>> values) { InitializeComponent(); _parameters = new ObservableCollection<Y_NORM_MANAGEMENT_GET_PARAMETER_VALUES_Result>(); listBoxAllParams.ItemsSource = _parameters; foreach (var value in values) { var listBoxSelected = new ListBoxEdit {SelectionMode = SelectionMode.Extended, ItemsSource = value}; rowParams.Children.Add(listBoxSelected); } ParametersSort(false); }
private void BtnRightClick(object sender, RoutedEventArgs e) { if (_parameters.Count == 0 || listBoxAllParams.SelectedItems.Count == 0) return; var listBoxSelected = new ListBoxEdit {SelectionMode = SelectionMode.Extended}; var collection = new ObservableCollection<Y_NORM_MANAGEMENT_GET_PARAMETER_VALUES_Result>(); foreach (object selectedItem in listBoxAllParams.SelectedItems) { collection.Add((Y_NORM_MANAGEMENT_GET_PARAMETER_VALUES_Result) selectedItem); } listBoxSelected.ItemsSource = collection; rowParams.Children.Add(listBoxSelected); foreach (Y_NORM_MANAGEMENT_GET_PARAMETER_VALUES_Result o in collection) { _parameters.Remove(o); } listBoxAllParams.SelectedItems.Clear(); }
void list_PreviewMouseMove(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { if (isDragStarted) { ListBoxEdit listBoxEdit = (ListBoxEdit)sender; Customer item = (Customer)listBoxEdit.SelectedItem; if (item != null) { DataObject data = CreateDataObject(item); data.SetData("dragSource", listBoxEdit); DragDrop.DoDragDrop(listBoxEdit, data, DragDropEffects.Copy); isDragStarted = false; } } } }
void PART_Editor_DefaultButtonClick(object sender, RoutedEventArgs e) { ListBoxEdit listBoxEdit = new ListBoxEdit() { ItemsSource = NWindContext.Create().CountriesArray, ShowBorder = false }; listBoxEdit.EditValue = treeList.GetCellValue(treeListView.FocusedRowHandle, (TreeListColumn)treeList.CurrentColumn); DialogClosedDelegate closedHandler = delegate(bool?dialogResult) { if (dialogResult == true) { treeListView.ShowEditor(); treeListView.ActiveEditor.EditValue = listBoxEdit.EditValue; } }; FloatingContainer.ShowDialogContent(listBoxEdit, treeListView.ActiveEditor, new Size(400, 300), new FloatingContainerParameters() { ClosedDelegate = closedHandler, Title = "Select Country", ContainerFocusable = false }); }
public static ResolveOverlappingMode GetMode(ListBoxEdit listBox) { switch (listBox.SelectedIndex) { case 0: return(ResolveOverlappingMode.None); case 1: return(ResolveOverlappingMode.Default); case 2: return(ResolveOverlappingMode.HideOverlapped); case 3: return(ResolveOverlappingMode.JustifyAroundPoint); case 4: return(ResolveOverlappingMode.JustifyAllAroundPoint); default: return(ResolveOverlappingMode.None); } }
int GetListBoxEditCount(ListBoxEdit listBoxEdit) { return(((System.Collections.IList)listBoxEdit.ItemsSource).Count); }
public ListBoxDragSource(ListBoxDragDropManager dragDropManager, ListBoxEdit listBox) : base(dragDropManager) { this.listBox = listBox; }
protected void UpdateBinding(ListBoxEdit cb) { cb.SelectedIndex = 1; }