binding

How to bind click of a button to change the content of a panel (Grid) using XAML

孤街醉人 提交于 2019-12-12 07:22:26
问题 I am creating a UI of a WPF Application, and while working on the implementation of the software's features, i didn't have much experience with creating the UI. Now I need to a way to change the contents of the Properties panel which has a grid to contain the content. I have created multiple panels, hidden all but one, and now i want to switch when the user clicks on a button in the Ribbon on the top, (or it could be any button somewhere else in the layout). It is very easy to do with code,

Multibinding as resource in XAML

♀尐吖头ヾ 提交于 2019-12-12 07:17:17
问题 Is it possible (if yes how), to add multivaluebinding expression into resource. I have a Multivalue binding, that takes 2 separate binding, and converter parameter in one of those binding. I have to use this binding to 5 Different items, and those binding tags differ only in converter parameter. Rest everything is same. I would to avoid repetition of multibinding boilerplate tags. 回答1: Easy way of seeing if something works: TRY IT! <Style TargetType="Button"> <Setter Property="Content">

WPF ObservableCollection Edit Mode

∥☆過路亽.° 提交于 2019-12-12 07:15:00
问题 I am using observable collections all around my applications. My problem is that when i use a popup window for editing those entities, my bound lists are getting changed when the user changes those corresponding fields in the window. How could i simply freeze the observable changes norifications, and release them only when the entity is saved? Thanks, Oran 回答1: You could make a deep copy of the object you want to edit. This way, you can act on the copy while editing, without interfering with

WPF: How to change the visibility of my ComboBox Items?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 06:48:42
问题 I know that this topic is already answered, but i couldn't solve the problem with the solution that i found. So here is my code: <DataGrid HeadersVisibility="Column" Name="griglia" Grid.Row="2" ItemsSource="{Binding Path=Test}" AutoGenerateColumns="True" IsReadOnly="True" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible"> <DataGrid.ColumnHeaderStyle> <Style TargetType="{x:Type DataGridColumnHeader}">

TextBox leave causes PropertyChanged get fired twice

家住魔仙堡 提交于 2019-12-12 06:48:02
问题 When the Text property of a TextBox is bound to an object property which that object implements INotifyPropertyChanged , the event PropertyChanged may fire two times while having the same value: 1) when the text is changed inside the TextBox 2) when the control is leaving from it. Consider these methods of a form: private void Form1_Load(object sender, EventArgs e) { TextBox textBox = new TextBox(); TextBox secondTextBox = new TextBox(); secondTextBox.Location = new Point(0, 100); this

CurrentPosition property not being updated properly

ⅰ亾dé卋堺 提交于 2019-12-12 06:12:22
问题 Let me try again...here is the XAML. You can see the CollectionViewSource, the Grid that uses it as a DataContext, the ListView, and the Delete button. What is happening is that when i click on a row in the ListView (and the Style trigger fires to select the ListViewItem) the row is selected. When i click the Delete button the onclick fires but the CurrentPosition property is set to -1. What is preventing the CurrentPosition property from being updated. XAML <Window x:Class="PretzelsUI.Admin

Check for net.tcp binding in PowerShell

坚强是说给别人听的谎言 提交于 2019-12-12 06:06:14
问题 I am configuring a process that checks IIS settings on a Web Server for net.tcp bindings for a particual Web Site, and if it does not exist, create it. I have this chunk of code to check $Websites = Get-ChildItem IIS:\Sites foreach ($Site in $Websites) { if ($Site.name -eq "LOSSI") { $Binding = $Site.bindings foreach ($bind in $Binding.collection) { if ($bind -eq "net.tcp 443:*") { Write-Host $bind } } } } But I never fall into the last conditional. I have validated by hand that the binding

WPF: disable bindings update on detach

不问归期 提交于 2019-12-12 05:54:16
问题 Here is the situation: I have an editor app, that edits some hierarchical data. The data itself is held in ViewModel class, and View class is responsible to reflect changes in ViewModel. The main part of the View is ContentControl. When data changes in ViewModel, a hierarchical structure of controls is (re)generated and top-level control becomes the Content of the ContentControl. Of course, those hierarchical controls have bindings. Now it's time to close the editor. ViewModel reacts to

Binding to change the property

萝らか妹 提交于 2019-12-12 05:52:04
问题 Is it usable or this doesn't work: to change the Text Box.Text and the property behind to change can a binding of this type be made(i know that this can be made with an event from Text Box, i am looking for some kind of binding that can be made) ? Should i just use Text Box.Text in my cod? <TextBox Text="{Binding Path=NumeClient, Mode=TwoWay}" Height="23" HorizontalAlignment="Left" Margin="117,21,0,0" Name="textBox1" VerticalAlignment="Top" Width="249" /> public string NumeClient { get; set;

Detail page of split app without model

帅比萌擦擦* 提交于 2019-12-12 05:49:14
问题 In my split app the detail view does not bind any model. In the component.js I instantiate a named model like this: // creation and setup of the oData model var oConfig = { metadataUrlParams: {}, json: true, defaultBindingMode : "TwoWay", defaultCountMode : "Inline", useBatch : false } // ### tab-employee ### var oModelEmpl = new sap.ui.model.odata.v2.ODataModel("/sap/opu/odata/sap/EMP_SRV"), oConfig); oModelEmpl.attachMetadataFailed(function() { this.getEventBus().publish("Component",