binding

Binding doesn't work on DependencyObject created in XAML

偶尔善良 提交于 2021-02-08 20:33:24
问题 I'm trying to pass multiple CommandParameters in XAML with the use of a custom class. I have created a class called ValueCommandArgs that inherits from DependencyObject and has two DepencyProperties (lets call them Value1 and Value2 for this example). The button which is supposed to call a command and pass this object looks like this: <Button Command="{Binding ChangeValueCommand}" Content="Execute Command"> <Button.CommandParameter> <args:ValueCommandArgs Value1="{Binding TestValue1}" Value2=

Binding doesn't work on DependencyObject created in XAML

流过昼夜 提交于 2021-02-08 20:32:25
问题 I'm trying to pass multiple CommandParameters in XAML with the use of a custom class. I have created a class called ValueCommandArgs that inherits from DependencyObject and has two DepencyProperties (lets call them Value1 and Value2 for this example). The button which is supposed to call a command and pass this object looks like this: <Button Command="{Binding ChangeValueCommand}" Content="Execute Command"> <Button.CommandParameter> <args:ValueCommandArgs Value1="{Binding TestValue1}" Value2=

WPF: Hydrate Canvas with Draggable Controls at Runtime

做~自己de王妃 提交于 2021-02-08 11:02:11
问题 This is what I'm trying to accomplish: I want to have a canvas that supports dragging and dropping arbitrary data in the style of Microsoft Visio. I've found this link that does that: http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part1.aspx However, I also want to hydrate the canvas at run-time. I found this post: https://stackoverflow.com/questions/889825/wpf-is-it-possible-to-bind-a-canvass-children-property-in-xaml One of the solutions suggests drawing each item on it's own Canvas,

WPF: Hydrate Canvas with Draggable Controls at Runtime

烂漫一生 提交于 2021-02-08 11:01:08
问题 This is what I'm trying to accomplish: I want to have a canvas that supports dragging and dropping arbitrary data in the style of Microsoft Visio. I've found this link that does that: http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part1.aspx However, I also want to hydrate the canvas at run-time. I found this post: https://stackoverflow.com/questions/889825/wpf-is-it-possible-to-bind-a-canvass-children-property-in-xaml One of the solutions suggests drawing each item on it's own Canvas,

How do I bind a WPF combo box to a different list when the dropdown is open?

∥☆過路亽.° 提交于 2021-02-08 10:10:26
问题 I have several combo boxes in a Scheduling module that all have dropdown lists based on an "Active" field. public class Project { public int ProjectID { get; set; } public int ProjectTitle { get; set; } public bool Active { get; set; } } <ComboBox Name="ProjectComboBox" ItemsSource="{Binding AllProjects}" SelectedItem="{Binding Project, Mode=TwoWay}"> </ComboBox> The calendar's editing form must always display legacy information in its combo boxes, even if a particular item in a combo list

How do I bind a WPF combo box to a different list when the dropdown is open?

為{幸葍}努か 提交于 2021-02-08 10:06:33
问题 I have several combo boxes in a Scheduling module that all have dropdown lists based on an "Active" field. public class Project { public int ProjectID { get; set; } public int ProjectTitle { get; set; } public bool Active { get; set; } } <ComboBox Name="ProjectComboBox" ItemsSource="{Binding AllProjects}" SelectedItem="{Binding Project, Mode=TwoWay}"> </ComboBox> The calendar's editing form must always display legacy information in its combo boxes, even if a particular item in a combo list

Why bindings don't work with animations?

て烟熏妆下的殇ゞ 提交于 2021-02-08 05:10:54
问题 I have a simple problem with an animated binded property. Here is a simple example to illustrate it : ViewModel : public class ViewModel { private double myProperty; public double MyProperty { get { return myProperty; } set { myProperty = value; /* Break point here */ } } public ViewModel() { MyProperty = 20; } } MyControl : public class MyControl : Button { protected override void OnClick() { base.OnClick(); Height = ActualHeight + 20; } } MyAnimatedControl : public class MyAnimatedControl :

WPF FlowDocument Binding

末鹿安然 提交于 2021-02-08 04:11:47
问题 I am using Microsoft's XAML/HTML converter to convert HTML from a database into a XAML string. The Microsoft converter seems to be formatting the text correctly, but I'm having trouble binding the output to a XAML object. For example, using the following HTML: <span style="font-weight: bold; font-family: Georgia; color: rgb(0, 96, 144); text-decoration: underline;">Hello world.</span> I will get the XAML output: <Section xml:space="preserve" xmlns="http://schemas.microsoft.com/winfx/2006/xaml

WPF FlowDocument Binding

浪子不回头ぞ 提交于 2021-02-08 04:10:09
问题 I am using Microsoft's XAML/HTML converter to convert HTML from a database into a XAML string. The Microsoft converter seems to be formatting the text correctly, but I'm having trouble binding the output to a XAML object. For example, using the following HTML: <span style="font-weight: bold; font-family: Georgia; color: rgb(0, 96, 144); text-decoration: underline;">Hello world.</span> I will get the XAML output: <Section xml:space="preserve" xmlns="http://schemas.microsoft.com/winfx/2006/xaml

xamarin forms xaml OnPlatform not working on bindings

安稳与你 提交于 2021-02-07 21:54:22
问题 <cv:BindableComboBox ItemsSource="{Binding Themes}" SelectedValue="{Binding SelectedTheme}"> <cv:BindableComboBox.Title> <OnPlatform x:TypeArguments="x:String" iOS="{Binding ThemePickerTitle}" Android="{Binding ThemePickerTitle}"/> </cv:BindableComboBox.Title> </cv:BindableComboBox> so I have picker and I want to bind its Title to ThemePickerTitle property. It works well if I write it as inline attrubute. But I dont want to have title on windows. So I write OnPlatform to have it only on Ios