binding

“A registration already exists for URI” when hosting same service for HTTPS and HTTP

大城市里の小女人 提交于 2019-12-21 02:27:09
问题 I am trying to host the same service inside the same website using two endpoints one HTTP and the other HTTPS. The problem is I can happily call one service (whichever I call first works) but then call to the other fails until I iisreset and try again. SO I can happily call both but one at a time until a process recycle. I have exhausted (or I think I have) all relevant Q&A and documents that I could find and none of them seem to help me. The level of documentation of MSDN regarding these

How to dynamically change a WPF control's template using a checkbox?

混江龙づ霸主 提交于 2019-12-21 02:02:35
问题 I have an error dialog (shown simplified below). I display the Report object in a ContentControl to which I have defined a Template simpleErrorTemplate . There is a CheckBox on the Window that I would like to use to change the template to/from detailedErrorTemplate . What is the best way to achieve this? <Window x:Class="Core.ErrorDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Window.Resources>

How does binding elementname work exactly?

余生长醉 提交于 2019-12-20 23:32:11
问题 I remember reading a couple of weeks ago that it sometimes doesn't work inside templates, and I recently tried to bind things in two different windows and it couldn't find the name declarations, so I assumed that it was local to the namespace of the class and just bound by setting the datacontext instead. However, I'm really curious when I am able to use binding elementname and when I cannot, because it's far more convenient when it is possible. edit: In reading that article, I found this to

How does binding elementname work exactly?

允我心安 提交于 2019-12-20 23:32:04
问题 I remember reading a couple of weeks ago that it sometimes doesn't work inside templates, and I recently tried to bind things in two different windows and it couldn't find the name declarations, so I assumed that it was local to the namespace of the class and just bound by setting the datacontext instead. However, I'm really curious when I am able to use binding elementname and when I cannot, because it's far more convenient when it is possible. edit: In reading that article, I found this to

Binding a collection to WPF ComboBox and disable some items

浪尽此生 提交于 2019-12-20 21:30:12
问题 <Window.Resources> <DataTemplate x:Key="IpInfoTemplate"> <DockPanel> <TextBlock Text="{Binding Path=InterfaceName}" DockPanel.Dock="Left" Margin="0,0,10,0" /> <TextBlock Text="{Binding Path=Address}"/> </DockPanel> </DataTemplate> </Window.Resources> <ComboBox ItemTemplate="{StaticResource IpInfoTemplate}" ItemsSource="{Binding Source={x:Static WpfApplication1:App.IpInfoList}, Mode=OneWay}"> </ComboBox> This code has binded App.IpInfoList to ComboBox. IpInfo class has a bool property Enabled

How to bind a control's property to another control's property?

大兔子大兔子 提交于 2019-12-20 17:35:28
问题 I want that the SaveButton from my form to dissapear when the form is disabled. I do that this way: this.formStackPanel.IsEnabled = someValue; if(this.formStackPanel.IsEnabled) { this.saveButton.Visibility = Visibility.Visible; } else { this.saveButton.Visibility = Visibility.Collapsed; } Isn't there a way of binding those properties in the XAML? Is there a better way of doing that? 回答1: Yes. You should be able to bind the stackpanel's IsEnabled to your button's Visibility property. However,

Why is DataAnnotations <Display(Name:=“My Name”)> ignored when using a DataGrid with AutoGenerateColumns=“True”

自闭症网瘾萝莉.ら 提交于 2019-12-20 14:24:54
问题 I'm using the WPF DataGrid to bind to a collection of a custom class. Using AutoGenerateColumns="True" in the grid XAML, the grid is created and populated just fine, but the headings are the property names, as one would expect. I tried specifying <Display(Name:="My Name")> from the System.ComponentModel.DataAnnotations namespace and that has no effect. I also tried <DisplayName("My Name")> from the System.ComponentModel name space but still the headings are not affected. Is there no way to

Why is DataAnnotations <Display(Name:=“My Name”)> ignored when using a DataGrid with AutoGenerateColumns=“True”

ε祈祈猫儿з 提交于 2019-12-20 14:24:19
问题 I'm using the WPF DataGrid to bind to a collection of a custom class. Using AutoGenerateColumns="True" in the grid XAML, the grid is created and populated just fine, but the headings are the property names, as one would expect. I tried specifying <Display(Name:="My Name")> from the System.ComponentModel.DataAnnotations namespace and that has no effect. I also tried <DisplayName("My Name")> from the System.ComponentModel name space but still the headings are not affected. Is there no way to

Command Binding in hierarchical datatemplate

我的未来我决定 提交于 2019-12-20 14:10:44
问题 I have Menu in my app. I'm visualizing it using hierarchical data template: <MenuItem Header="Main menu" ItemsSource="{Binding ApplicationMenu}" > <MenuItem.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type tm:RMenuItem}" ItemsSource="{Binding Path=ChildrenItems}"> <MenuItem Header="{Binding Name}" Command="{Binding RunOperationCommand}" /> </HierarchicalDataTemplate> </MenuItem.ItemTemplate> </MenuItem> menu looks like as it should, but Command for each menu item is not fired! Even

Command Binding in hierarchical datatemplate

馋奶兔 提交于 2019-12-20 14:09:17
问题 I have Menu in my app. I'm visualizing it using hierarchical data template: <MenuItem Header="Main menu" ItemsSource="{Binding ApplicationMenu}" > <MenuItem.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type tm:RMenuItem}" ItemsSource="{Binding Path=ChildrenItems}"> <MenuItem Header="{Binding Name}" Command="{Binding RunOperationCommand}" /> </HierarchicalDataTemplate> </MenuItem.ItemTemplate> </MenuItem> menu looks like as it should, but Command for each menu item is not fired! Even