Hi,
I create a UserControl (TableWithFilter.xaml) with a dependency property (source). The UserControl is a Table with a source property for the different items. I created the XAML and set the source property via the XAML Binding. So far so good.
But if the value of the dependency property is changed, the defined callback method is not...
I'm a bit in a mess with how to set a Dependency Property for Custom Control.
I created Custom Control, so it derives from Control class.
public class CustControl : Control
{
static CustControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(CustControl), new FrameworkPropertyMetadata(typeof(CustControl...
I try to use enum type as a dependency property in my custom control, but always get an error:
public enum PriceCategories
{
First = 1,
Second = 2,
Third = 3,
Fourth = 4,
Fifth = 5,
Sixth = 6
}
public static readonly DependencyProperty PriceCatProperty =
DependencyProperty.Regi...
After running WPF animations on dependency properties in code behind, the dependency properties can no longer be set using SetValue. They can only be changed through animations.
I want to change a dependency property, some times through short animations, sometimes immediately in code.
So how can I remove the animation from a dependency...
This is what I want: I have a custom Panel which arranges a certain type of item. My Panel also has a few dependency properties (ArrangeMode, MinDate, ...), which influence the rendering. Example:
<TimeLinePanel ArrangeMode="Compact" MinDate="...">
<TimeLineItem ... />
<TimeLineItem ... />
</TimeLinePanel>
To be able to data-b...
Hello,
I'm trying to bind a Dependency Property from my UserControl to my MainViewModel.
This is how the DependencyProperty looks like:
public static DependencyProperty ItemHasChangesProperty = DependencyProperty.Register("ItemHasChanges",
typeof(boo...
I have another WPF databinding question... one that I haven't found an answer to anywhere, and this surprises me since it seems like it is very basic.
Essentially, I have a string in code behind that I would like to establish a two-way binding with with a textbox in my GUI. I thought it was a simple matter of creating a DependencyPrope...
Hi,
I've got a custom control which has a DependencyProperty MyAnimal - I'm binding an Animal Property on my ViewModel to the MyAnimal DependencyProperty.
I've stuck a TextBox on the Control so I can trigger an Event - whenever I trigger the event the MyAnimal property has been set - however if I put a break point on the Setter of the ...
Silverligh 4, VS 2010.
Making a Custom Control. (Non just UserControl, but public class HandPart : Control, and a template in \themes)
Then I creating a new DependencyProperty with a helper snippet:
#region SomeDouble (DependencyProperty)
/// <summary>
/// A description of the property.
/// </summary>
public Double SomeDouble
{
...
Hey pals,
let's put it short: I'm trying to create a WPF custom control that inherits from WPF Image. I have added a dependency property called "Source Type" to my control so that when databound it sets the "Source" property of the image to what I want.
But the problem is that my method to perform the source changing task (i.e "OnSourc...
Here's the situation: I have a custom TextBox control that contains multiple other TextBox controls. I need to turn IsTabStop off in the parent control, but I still want to expose a new IsTabStop property, which the sub-textboxes are template-bound to. I wrote the following code:
using System.Windows.Controls;
public class CustomTextBo...
I have been wrestling with getting databinding to work in WPF for a little over a week. I did get valuable help here regarding the DataContext, and I did get databinding to work via DependencyProperties. While I was learning about databinding, I came across numerous discussions about INotifyPropertyChanged and how it is better than DPs...
Hi, I am subclassing an ItemsControl (let's call it EnhancedItemsControl), and I would like to expose ScrollViewerTemplate dependency property, which would allow the user to optionally specify his own template for used ScrollViewer. I am doing it like this:
public ControlTemplate ScrollViewerTemplate
{
get { return (ControlTemplate)G...
If I have a ChildWindow in Silverlight I can apply the FontSizeProperty and it is inherited by child items.
<controls:ChildWindow FontSize="14">
<StackPanel>
<TextBlock Content="Hello">
<TextBlock Content="World">
</StackPanel>
</controls:ChildWindow>
Now that's fine if you want the whole page to have t...
I'm using a viewmodel pattern, so my DataContext for my custom user control is actually a viewmodel wrapper for the real data.
My custom control can contain hierarchal instances of the custom control.
I set up a DependencyProperty in the custom control for the real piece of data, with the hopes of creating a new viewmodel for that data...
I know ContextMenus aren't part of the visual tree, but I've been trying to bind the Visibility property of a contextmenu to a property on it's parent UserControl. So far I've tried ancestor binding and experimented with a converted, but the only way that seems remotely feasible at the minute is to use a MultiValueConverter and reflectio...
I have a two userControls (IconUserControl & DisplayUserControl), I'm having a problem with binding dependency properties, here's some detail:
IconUserControl has a bool DP of IsDisplayShown
DisplayUserControl has a bool DP of IsDisplayShown
In the XAML I have:
<local:DisplayUserControl
x:Name="DisplayUserControl...
I have a class which has a DependencyProperty member:
public class SomeClass : FrameworkElement
{
public static readonly DependencyProperty SomeValueProperty
= DependencyProperty.Register(
"SomeValue",
typeof(int),
typeof(SomeClass));
new PropertyMetadata(
new P...
I'm puzzled. I'm trying to create a user control called TranslationView. It consists pretty much entirely of a single ListView. I don't think that's important now however, because I cannot even compile my code-behind.
This is the code-behind for the user control:
namespace Subster
{
/// <summary>
/// Interaction logic for Tr...
I have this DP:
public bool ShowEntireHierarchyEx
{
get { return (bool)GetValue(ShowEntireHierarchyExProperty); }
set { SetValue(ShowEntireHierarchyExProperty, value); }
}
public static readonly DependencyProperty ShowEntireHierarchyExProperty =
DependencyProperty.Register("ShowEntireHierarchyEx"...