private static void OnLabelPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { var d = dependencyObject as DropDownSelectionList; var newValue = (string)e.NewValue; HintAssist.SetHint(d, newValue); }
protected override void LanguageChanged() { #region Top Tree Translate WindowTitle.Text = LanguagableComponent.GetTransLation(new string[] { "Select one component", "选择一个运算器" }); HintAssist.SetHint(SearchBox, new Label() { Content = LanguagableComponent.GetTransLation(new string[] { "Search", "搜索" }), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }); CancelButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to cancel the changes and close this window.", "单击以取消修改,并关闭此窗口。" }); OKButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to comfirm the change and close the window.", "单击以确认修改并关闭窗口。" }); #endregion #region Major Box IconColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Icon", "图标" }); FullNameColumn.Header = LanguagableComponent.GetTransLation(new string[] { "FullName", "全名" }); CategoryColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Category", "类别" }); SubcategoryColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Subcategory", "子类别" }); ExposureColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Exposure", "分栏" }); GuidColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Guid", "全局唯一标识符(Guid)" }); FirstExpenderName.Text = LanguagableComponent.GetTransLation(new string[] { "Filter", "过滤器" }); #endregion }
private void AddNewTextBox(int starting = 1, int ending = 1) { for (int i = starting; i <= ending; i++) { var textBox = new TextBox { Name = "TextBox" + ++this.counter, Margin = new Thickness(10, 10, 10, 10), CharacterCasing = CharacterCasing.Upper }; // Material Design Properties HintAssist.SetHint(textBox, "Enter Coach Number"); HintAssist.SetIsFloating(textBox, true); var s = "TextBox" + (this.counter - 1); var findOldTextBox = ExtendedVisualTreeHelper.FindChild <TextBox>(this.StackPanel, s); if (string.IsNullOrWhiteSpace(findOldTextBox?.Text)) { return; } var newTextBoxText = Regex.IsMatch(findOldTextBox.Text, @"^\w+\d+\-\d+") ? $"{new string(findOldTextBox.Text.TakeWhile(char.IsLetter).ToArray())}{i}" : $"{new string(findOldTextBox.Text.TakeWhile(char.IsLetter).ToArray())}{Math.Max(this.counter, i)}"; textBox.Text = newTextBoxText; this.ScrollViewer.ScrollToEnd(); this.StackPanel.Children.Add(textBox); } }
/// <summary> /// Creates a prompt box which prompts the user to enter which variable meaning he wants to define /// </summary> /// <param name="variableOfInterest">Either X or Y</param> /// <param name="displayingWindow">The window in which the dialog will be displayed</param> public CustomXYMeaningPrompt(Variables variableOfInterest) { InitializeComponent(); AssignVariableMeaningTitle.Text = variableOfInterest + AssignVariableMeaningTitle.Text; HintAssist.SetHint(MeaningTextField, $"Enter the meaning of {variableOfInterest} here"); }
public TitleFormControl() { this.InitializeComponent(); this.WhenActivated(disposables => { this.WhenAnyValue(v => v.ViewModel) .BindTo(this, v => v.DataContext) .DisposeWith(disposables); this.Bind(this.ViewModel, vm => vm.Name, v => v.NameTextBox.Text) .DisposeWith(disposables); this.NameTextBox.ValidateWith(this.ViewModel !.NameRule) .DisposeWith(disposables); HintAssist.SetHint( this.NameTextBox, this.ViewModel.Title.IsOriginal ? Messages.OriginalTitle : Messages.Title); this.BindCommand(this.ViewModel !, vm => vm.Delete, v => v.DeleteButton) .DisposeWith(disposables); this.ViewModel.Delete.CanExecute .BindTo(this, v => v.DeleteButton.Visibility) .DisposeWith(disposables); }); }
/// <summary> /// The button add on click. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void ButtonAddOnClick([CanBeNull] object sender, [CanBeNull] RoutedEventArgs e) { if (this.counter != 0) { var s = "TextBox" + this.counter; var findTextBox = ExtendedVisualTreeHelper.FindChild <TextBox>(this.StackPanel, s); if (string.IsNullOrWhiteSpace(findTextBox?.Text)) { MessageBox.Show("Please update previous text field(s)"); return; } } var textBox = new TextBox { Name = "TextBox" + ++this.counter, Margin = new Thickness(10, 10, 10, 10), CharacterCasing = CharacterCasing.Upper }; // Material Design Properties HintAssist.SetHint(textBox, "Enter Coach Number"); HintAssist.SetIsFloating(textBox, true); // Update ScrollViewer this.ScrollViewer.ScrollToEnd(); // Update Static class DataHelper DataHelper.StatusForEnable = false; this.StackPanel.Children.Add(textBox); }
protected override void LanguageChanged() { #region Top Tree Translate WindowTitle.Text = LanguagableComponent.GetTransLation(new string[] { "Param Settings Window", "参数设定窗口" }); FilterButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to add the components selected on the canvas to list.", "点击以将在画布中选中的运算器添加到列表当中" }); HintAssist.SetHint(SearchBox, new Label() { Content = LanguagableComponent.GetTransLation(new string[] { "Search", "搜索" }), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }); #endregion #region Major Box EditColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Edit", "编辑" }); TypeNameColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Type Name", "类型名称" }); TypeFullNameColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Type FullName", "类型全名" }); AssemNameColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Assembly Name", "类库名称" }); AssemIdColumn.Header = LanguagableComponent.GetTransLation(new string[] { "Assembly Guid", "类库全局唯一标识符(Guid)" }); FirstExpenderName.Text = LanguagableComponent.GetTransLation(new string[] { "Filter", "过滤器" }); SecondExpenderName.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Column Visibility", "列可视性" }); #endregion #region B0ttom Four Translate FileOption.ToolTip = LanguagableComponent.GetTransLation(new string[] { "File Option", "文件选项" }); AsDefaultButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to save as template.", "点击以保存一个模板。" }); ImportButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to import a file.", "点击以导入一个文件。" }); ExportButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to export a file.", "点击以导出一个文件。" }); CancelButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to cancel the changes and close this window.", "单击以取消修改,并关闭此窗口。" }); OKButton.ToolTip = LanguagableComponent.GetTransLation(new string[] { "Click to comfirm the change and close the window.", "单击以确认修改并关闭窗口。" }); #endregion }
public RangeFilterInputControl() { this.InitializeComponent(); this.WhenActivated(disposables => { this.WhenAnyValue(v => v.ViewModel) .BindTo(this, v => v.DataContext) .DisposeWith(disposables); this.RangeStartBox.DisposeWith(disposables); this.RangeEndBox.DisposeWith(disposables); this.Bind(this.ViewModel, vm => vm.Start, v => v.RangeStartBox.Number) .DisposeWith(disposables); this.Bind(this.ViewModel, vm => vm.End, v => v.RangeEndBox.Number) .DisposeWith(disposables); this.WhenAnyValue(v => v.ViewModel !.Description) .Select(description => Messages.ResourceManager.GetString($"FilterDescription{description}")) .WhereNotNull() .Subscribe(description => { HintAssist.SetHint( this.RangeStartBox, String.Format(Messages.FilterRangeStartDescriptionFormat, description)); HintAssist.SetHint( this.RangeEndBox, String.Format(Messages.FilterRangeEndDescriptionFormat, description)); }) .DisposeWith(disposables); }); }
private void CurrencyRequirementTypeComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { if (this.CurrencyRequirementTypeComboBox.SelectedIndex >= 0) { CurrencyRequirementTypeEnum requirementType = EnumHelper.GetEnumValueFromString <CurrencyRequirementTypeEnum>((string)this.CurrencyRequirementTypeComboBox.SelectedItem); if (requirementType == CurrencyRequirementTypeEnum.NoCurrencyCost) { this.CurrencyCostsGrid.IsEnabled = false; } else { this.CurrencyCostsGrid.IsEnabled = true; this.CurrencyMaximumCostTextBox.IsEnabled = (requirementType == CurrencyRequirementTypeEnum.MinimumAndMaximum); if (requirementType == CurrencyRequirementTypeEnum.RequiredAmount) { HintAssist.SetHint(this.CurrencyMinimumCostTextBox, "Required Amount"); } else { HintAssist.SetHint(this.CurrencyMinimumCostTextBox, "Minimum Amount"); } } } }
private void menuAddFileRedirection_Click(object sender, RoutedEventArgs e) { //Don't need these for file redirection this.buttonAddFileOpen.Visibility = Visibility.Collapsed; this.checkboxAddFileCompressed.Visibility = Visibility.Collapsed; //File redirection needs other hints HintAssist.SetHint(this.textboxAddFileFilePath, "Path"); HintAssist.SetHint(this.textboxAddFilePath, "File Redirection"); }
public void RefreshWindowControls() { // Add controls to Dictionary for easier navigation. _controls.Clear(); var panel = new StackPanel { Name = "MainInfoPanel" }; var idBox = new TextBox { Name = "IdBox", Text = _bossId.ToString(), Margin = new Thickness(10), IsEnabled = false }; var nameBox = new ComboBox { Name = "NameBox", ItemsSource = GameAssets.Bosses.Select(x => x.Name), Margin = new Thickness(10) }; nameBox.SelectedValue = GameAssets.Bosses.FirstOrDefault(x => x.Id == _bossId)?.Name; nameBox.SelectionChanged += NameBox_SelectionChanged; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); _controls.Add(idBox.Name, idBox); _controls.Add(nameBox.Name, nameBox); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } MainGrid.Children.Add(panel); }
private void IncludeExclamationInCommandsToggleButton_Checked(object sender, System.Windows.RoutedEventArgs e) { if (this.IncludeExclamationInCommandsToggleButton.IsChecked.GetValueOrDefault()) { HintAssist.SetHint(this.ChatCommandTextBox, ChatTriggersNoExclamationHintAssist); } else { HintAssist.SetHint(this.ChatCommandTextBox, ChatTriggersHintAssist); } }
private void WildcardsToggleButton_Checked(object sender, System.Windows.RoutedEventArgs e) { if (this.WildcardsToggleButton.IsChecked.GetValueOrDefault()) { this.IncludeExclamationInCommandsToggleButton.IsChecked = this.IncludeExclamationInCommandsToggleButton.IsEnabled = false; HintAssist.SetHint(this.ChatCommandTextBox, MixItUp.Base.Resources.ChatTriggersHintAssist); } else { this.IncludeExclamationInCommandsToggleButton.IsChecked = this.IncludeExclamationInCommandsToggleButton.IsEnabled = true; } }
private void InitializeStartTime(DateTime dt) { GetYearMonthDayFromDateTime(dt, out int year, out int month, out int day, out bool isLeapMonth); StartYear.Text = year.ToString(); StartMonth.Text = month.ToString(); if (isLeapMonth) { HintAssist.SetHint(StartMonth, "闰月"); } StartDay.Text = day.ToString(); StartTimePicker.SelectedTime = dt; }
public async Task <string> ShowAsync(string title, bool multipleLines, string hint = "", string defaultContent = "") { tbkDialogTitle.Text = title; HintAssist.SetHint(textArea, hint); textLine.Visibility = multipleLines ? Visibility.Collapsed : Visibility.Visible; textArea.Visibility = multipleLines ? Visibility.Visible : Visibility.Collapsed; InputContent = defaultContent; Notify(nameof(InputContent)); await dialog.ShowDialog(dialog.DialogContent); return(Result ? InputContent : ""); }
/// <summary> /// Creates a new control and returns it. /// </summary> /// <param name="configItem">The configuration item of the connector.</param> /// <param name="configItemAttribute">The configuration item attribute.</param> /// <returns> /// Returns the <see cref="FrameworkElement" /> for the <see cref="configItem" />. /// </returns> public override FrameworkElement GetControlInternal(IConfigurationItem configItem, ConfigurationItemAttribute configItemAttribute) { var comboBox = new ComboBox(); comboBox.DataContext = configItem; var style = Application.Current.FindResource("MaterialDesignFloatingHintComboBox") as Style; comboBox.Style = style; HintAssist.SetIsFloating(comboBox, true); HintAssist.SetHint(comboBox, configItemAttribute.Caption); return(comboBox); }
public ForceSetting(MapEditor _mapEditor, int _forceID) { InitializeComponent(); mapEditor = _mapEditor; forceID = _forceID; forceBinding = new ForceBinding(mapEditor, forceID); _mapEditor.mapDataBinding.forceBindings.Add(forceBinding); this.DataContext = forceBinding; HintAssist.SetHint(MainTB, "세력 " + (forceID + 1)); }
private void Button_Click_3(object sender, RoutedEventArgs e) { var txtbox = new TextBox(); txtbox.Margin = new Thickness(20); HintAssist.SetHint(txtbox, "hint AttrStrings"); var binding = new Binding($"AttrStrings[1]"); binding.Mode = BindingMode.TwoWay; binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; txtbox.SetBinding(TextBox.TextProperty, binding); mPanel.Children.Add(txtbox); }
private void text_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) { string line2 = text.Text; List <char> Line2 = new List <char> { }; foreach (char a in line2) { Line2.Add(a); } HintAssist.SetHint(text, $"Символов: {Line2.Count}"); }
private void DialogHost_DialogOpened(object sender, MaterialDesignThemes.Wpf.DialogOpenedEventArgs eventArgs) { IndexTextBox.Text = null; ActiveBorder.Visibility = Visibility.Visible; this.ComponentName.Text = _selectedProxy.FullName; System.Drawing.Bitmap bitmap = CanvasRenderEngine.GetObjectBitmap(_selectedProxy.CreateObejct(), this._isInput, out _); ShowcaseImage.Source = CanvasRenderEngine.BitmapToBitmapImage(bitmap); this.DialogCancelButton.Content = LanguagableComponent.GetTransLation(new string[] { "CANCEL", "取消" }); this.DialogFinishButton.Content = LanguagableComponent.GetTransLation(new string[] { "ACCEPT", "接受" }); HintAssist.SetHint(this.IndexTextBox, _isInput ? LanguagableComponent.GetTransLation(new string[] { "Output Index", "输出端索引" }) : LanguagableComponent.GetTransLation(new string[] { "Input Index", "输入端索引" })); }
private void DialogHost_DialogOpened(object sender, MaterialDesignThemes.Wpf.DialogOpenedEventArgs eventArgs) { ActiveBorder.Visibility = Visibility.Visible; HintAssist.SetHint(DialogSelect, new Label() { Content = LanguagableComponent.GetTransLation(new string[] { "Select Mode", "选择模式" }), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }); ColorMode.Content = LanguagableComponent.GetTransLation(new string[] { "Wire Color", "连线颜色" }); InputMode.Content = LanguagableComponent.GetTransLation(new string[] { "Input Control", "输入控制项" }); OutputMode.Content = LanguagableComponent.GetTransLation(new string[] { "Output Control", "输出控制项" }); DialogAccept.Content = LanguagableComponent.GetTransLation(new string[] { "ACCEPT", "接受" }); }
private void View_Transaction(object sender, RoutedEventArgs e) { string idBill = this.Textbox_Search.Text; if (CollectBillDAO.Instance.CheckIfExistBillID(idBill) == true) { IsWithdrawBill = false; CollectBill bill = CollectBillDAO.Instance.GetBill(idBill); Passbook passbook = PassbookDAO.Instance.GetAccount(bill.Collect_passbook); Customer customerInfo = CustomerDAO.Instance.GetCustomer(passbook.Passbook_customer); //update form this.TextBox_CustomerID.Text = customerInfo.Id.ToString(); this.TextBox_CustomerIDcard.Text = customerInfo.Cmnd.ToString(); this.TextBox_CustomerName.Text = customerInfo.Cus_name.ToString(); this.TextBox_CustomerAddress.Text = customerInfo.Cus_address.ToString(); this.TextBox_SavingBookID.Text = passbook.Id.ToString(); this.TextBox_Money.Text = bill.Collect_money.ToString(); this.Calender.SelectedDate = bill.Collectdate; this.Combobox_Type.Items.Clear(); this.Combobox_Type.Items.Add(TypePassbookDAO.Instance.GetTypeNameByID(passbook.Passbooktype)); this.Combobox_Type.SelectedIndex = 0; HintAssist.SetHint(this.TextBox_Money, "Số tiền gởi"); } else if (WithdrawBillDAO.Instance.CheckIfExistBillID(idBill) == true) { IsWithdrawBill = true; WithdrawBill bill = WithdrawBillDAO.Instance.GetBill(idBill); Passbook passbook = PassbookDAO.Instance.GetAccount(bill.Withdraw_passbook); Customer customerInfo = CustomerDAO.Instance.GetCustomer(passbook.Passbook_customer); //update form this.TextBox_CustomerID.Text = customerInfo.Id.ToString(); this.TextBox_CustomerIDcard.Text = customerInfo.Cmnd.ToString(); this.TextBox_CustomerName.Text = customerInfo.Cus_name.ToString(); this.TextBox_CustomerAddress.Text = customerInfo.Cus_address.ToString(); this.TextBox_SavingBookID.Text = passbook.Id.ToString(); this.TextBox_Money.Text = bill.Withdrawmoney.ToString(); this.Calender.SelectedDate = bill.Withdrawdate; this.Combobox_Type.Items.Clear(); this.Combobox_Type.Items.Add(TypePassbookDAO.Instance.GetTypeNameByID(passbook.Passbooktype)); this.Combobox_Type.SelectedIndex = 0; HintAssist.SetHint(this.TextBox_Money, "Số tiền rút"); } else { MessageBoxCustom.setContent("Không tìm thấy mã giao dịch này.").ShowDialog(); } #endregion }
private void Button_Click_1(object sender, RoutedEventArgs e) { var txtbox = new TextBox(); txtbox.Margin = new Thickness(20); HintAssist.SetHint(txtbox, "Payrec.Name"); var binding = new Binding($"{nameof(model.PayrecToSend)}.{nameof(model.PayrecToSend.Name)}"); binding.Mode = BindingMode.TwoWay; binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; binding.ValidatesOnNotifyDataErrors = true; txtbox.SetBinding(TextBox.TextProperty, binding); mPanel.Children.Add(txtbox); }
private void dialogHost_DialogClosing(object sender, DialogClosingEventArgs eventArgs) { //Default Values this.textboxAddFileFilePath.Text = ""; this.textboxAddFilePath.Text = ""; this.checkboxAddFileCompressed.IsChecked = true; //Default Hints HintAssist.SetHint(this.textboxAddFileFilePath, "File Path"); HintAssist.SetHint(this.textboxAddFilePath, "Path"); //Default Visibility this.checkboxAddFileCompressed.Visibility = Visibility.Visible; this.buttonAddFileOpen.Visibility = Visibility.Visible; }
private void EndMonth_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if ((bool)!ChineseCheckbox.IsChecked) { return; } if (HintAssist.GetHint(StartMonth).ToString() == "月") { HintAssist.SetHint(StartMonth, "闰月"); } else { HintAssist.SetHint(StartMonth, "月"); } }
/// <summary> /// Loads game categories to show them as textboxes on UI. /// </summary> private void LoadCategories() { Thickness textBlockMargin = new Thickness(30, 0, 0, 0); for (int index = 0; index < game.Categories.Count; index++) { playerAnswerCategoriesStackPanel.Children.Add(new TextBlock() { Text = game.Categories[index].Name, Margin = textBlockMargin, Foreground = Brushes.White }); categoriesStackPanels.Add(new StackPanel { Margin = textBlockMargin, Orientation = Orientation.Horizontal }); categoriesTextBox.Add(new TextBox() { VerticalAlignment = VerticalAlignment.Top, Width = 297, Height = 38, Margin = new Thickness(0, 0, 10, 10), Foreground = Brushes.White, Tag = index, MaxLength = 25 }); categoriesTextBox.Last().KeyDown += CategoryTextBox_KeyDown; HintAssist.SetHint(categoriesTextBox[index], game.LetterSelected + "..."); categoriesStackPanels[index].Children.Add(categoriesTextBox[index]); if (Session.DefaultCategoriesNameList.Contains(game.Categories[index].Name)) { categoriesButton.Add(new Button() { Content = Properties.Resources.GetWordButton, Margin = new Thickness(0, 0, 10, 0), Tag = index }); categoriesButton.Last().Click += CategoryGetWordButton_Click; categoriesStackPanels[index].Children.Add(categoriesButton.Last()); categoriesStackPanels[index].Children.Add(new TextBlock { Text = Session.ROUND_GET_WORD_COST + " " + Properties.Resources.ScorePointsText, Foreground = Brushes.White, Margin = new Thickness(0, 15, 0, 0) }); } playerAnswerCategoriesStackPanel.Children.Add(categoriesStackPanels[index]); } }
public void Update(IdiomaSubject idioma) { if (idioma.Idioma != null) { TraducirMenu(idioma); foreach (TextBlock textBlock in SingletonIdioma.FindWindowChildren <TextBlock>(this)) { if (textBlock.Tag != null) { Leyenda leyenda = idioma.Idioma.Leyendas.Find( delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)textBlock.Tag)); } ); if (leyenda != null) { textBlock.Text = leyenda.Traduccion.TextoTraducido; } } } foreach (ComboBox comboBox in SingletonIdioma.FindWindowChildren <ComboBox>(this)) { if (comboBox.Tag != null) { Leyenda leyenda = idioma.Idioma.Leyendas.Find( delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)comboBox.Tag)); } ); if (leyenda != null) { HintAssist.SetHint(comboBox, leyenda.Traduccion.TextoTraducido); } } } Leyenda leyendaCombo = idioma.Idioma.Leyendas.Find(delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)cmbIdioma.Tag)); } ); if (leyendaCombo != null) { HintAssist.SetHint(cmbIdioma, leyendaCombo.Traduccion.TextoTraducido); } } }
private void MyComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (MyComboBox.SelectedIndex == 0) { HintAssist.SetIsFloating(WorkDetailsTextBox, true); HintAssist.SetHint(WorkDetailsTextBox, "Company name"); } else if (MyComboBox.SelectedIndex == 1) { HintAssist.SetIsFloating(WorkDetailsTextBox, true); HintAssist.SetHint(WorkDetailsTextBox, "Corporation name"); } else if (MyComboBox.SelectedIndex == 2) { HintAssist.SetIsFloating(WorkDetailsTextBox, true); HintAssist.SetHint(WorkDetailsTextBox, "College name"); } }
private void AssociatedObject_TextInput(object sender, TextCompositionEventArgs e) { if (string.IsNullOrEmpty(TriggerChar)) { return; } var text = e.Text; if (text.StartsWith(TriggerChar, StringComparison.Ordinal)) { AutoCompletePopup.IsOpen = true; AutoCompleteBox.Focus(); HintAssist.SetHint(AutoCompleteBox, TriggerChar); AutoCompleteBox.Text = string.Empty; e.Handled = true; } }
public MainView() { InitializeComponent(); this.WhenActivated(disposable => { ViewModel.WhenAnyValue(model => model.SettingsViewModel.Settings.Value.X32Client.DisplayName) .Where(displayName => !string.IsNullOrWhiteSpace(displayName)) .Subscribe(displayName => HintAssist.SetHint(X32Client, displayName)); ViewModel.WhenAnyValue(model => model.SettingsViewModel.Settings.Value.X64Client.DisplayName) .Where(displayName => !string.IsNullOrWhiteSpace(displayName)) .Subscribe(displayName => HintAssist.SetHint(X64Client, displayName)); this.Bind(ViewModel, model => model.SettingsViewModel.Settings.Value.X32Client.Distance.Value, view => view.X32Client.Text) .DisposeWith(disposable); this.Bind(ViewModel, model => model.SettingsViewModel.Settings.Value.X64Client.Distance.Value, view => view.X64Client.Text) .DisposeWith(disposable); this.Bind(ViewModel, model => model.SettingsViewModel.Settings.Value.Dota2FolderPath, view => view.Dota2FolderPathTextBlock.Text) .DisposeWith(disposable); this.Bind(ViewModel, model => model.SettingsViewModel.Settings.Value.DarkMode, view => view.DarkModeTgb.IsChecked) .DisposeWith(disposable); this.Bind(ViewModel, model => model.SettingsViewModel.Settings.Value.Backup, view => view.BackupCheckBox.IsChecked) .DisposeWith(disposable); this.BindCommand(ViewModel, model => model.PatchCommand, view => view.PatchButton, model => model.SettingsViewModel.Settings.Value) .DisposeWith(disposable); this.BindCommand(ViewModel, model => model.SettingsViewModel.BrowseDota2FolderCommand, view => view.BrowseDota2FolderButton) .DisposeWith(disposable); Window.GetWindow(this).Events().Closing .Select(_ => ViewModel.SettingsViewModel.Settings.Value) .InvokeCommand(ViewModel.SettingsViewModel.SaveSettingsCommand); }); }