I'm working on a problem that seems like it might be solved by applying an Attribute to the DependencyProperty. I got curious and I can't find documentation that lists all the XXXAttribute classes that apply to DependencyProperties and what the attributes are used for. Does anyone know of anything like that? If not, maybe post some at...
I'm having a problem with my dependency property. It seems like it doesn't want to work at all, and I don't know why. Here is the code for my dependency property:
public static readonly DependencyProperty CheckBoxColumnVisibilityProperty =
DependencyProperty.Register("CheckBoxColumnVisibility", typeof(Visibility), typeof(Computers...
I am trying to add my own ItemsSource to provide a list of GraphViewModels to a chart. I dont think I have it quite right though, as when I create my first GraphViewModel and add it to the Graphs, my DP is updated, but OnGraphsCollectionChanged is not called.
How is this supposed to work? If I add graphs to my VM property via a button ...
How is it possible, that some custom Dependency Properties from a Custom WPF Control are in Visual Studio WPF Designer underlined like a Non-existing properties, but in reality they are defined and everything works well ?
Thanks
...
How do I add my property called weight to an image and use it like this:?
myImage.weight
(assuming i have already defined myImage in XAML)
here's my code:
public partial class MainWindow : Window
{
public double Weight
{
get
{
return (double)GetValue(WeightProperty);
}
set
{...
Here's the C# code directly from the website (http://jobijoy.blogspot.com/2007/10/time-picker-user-control.html) that everyone refers to when someone asks about TimePicker for WPF, although I moved it around a little bit to be more organized. (Please note, if you're trying to run this code to work with it: you must change the XAML code ...
Hi,
I have created a custom behavior that I can pass properties to fine, currently just strings, my behavior looks roughly like this:
public class ImageSourceBehavior : Behavior<Image>, INotifyPropertyChanged
{
public static readonly DependencyProperty ImageDirectoryProperty = DependencyProperty.Register("ImageDirectory", type...
I want to create a ControlTemplate that will trigger on vertain values of their DependancyProperties
for example a different image appear on a button
Anyway there are reasons why I need DependancyProperties
This is a sample of what could be in my user control .. I have just shown a simple example of an effect triggered by a property cha...
Here is a simplification of the problem
I want a Button with an extra DependancyProperty that I can bind to.
The value of this property will control which image is selcted on the button.
Question 2 is do I create a UserControl and draw the button on. If so how do I can use triggers to manage the image BUT I do not know how to do the T...
I have a custom control that has a Dependancy Property...it has a few but let us say Dragable is my problem. The property is a boolean and I want to execute a piece of code each time it changes...a toggle.
I have two options, both shown below
[Category("Modal Options")]
public bool Dragable
{
get { return (bool)GetValue...
Imagine a UserControl containing some sort of ItemsControl. The UserControl as a whole has a DataContext, but you also need to expose the ItemsSource of the ItemsControl.
I have tried all manner of arrangements, and eventually passed a DomainDataSource as a UserControl dependency property named DDS, and bound the ItemsControl like this:...
Situation: I have a string that represents the name of a DependencyProperty of a TextBox in Silverlight. For example: "TextProperty". I need to get a reference to the actual TextProperty of the TextBox, which is a DependencyProperty.
Question: how do I get a reference to a DependencyProperty (in C#) if all I got is the name of the prope...
Hi, I am trying to create DependencyProperties that have a nice drop down code completion when using them in the XAML-editor in Visual Studio.
Many default SilverLight framework properties have such completion, e.g., Background or BorderBrush. Also, Boolean Properties show the True/False selection in the XAML-editor. The same holds true...
I created a ComboBox subclass and added my functionality.
Now I want to expose external properties of the TextBox for example:
<a:MyComboBox SpellCheck.IsEnabled="True" TextBox.SelectedText="{Binding X}" />
Is this possible, I maybe didn't choose the wrong particular property but I guess you understand what I mean.
Is this possible?...
Hi,
i want to do add custom event handlers to default framework elements using DependencyProperties.
Something like the following:
<Border custom:MyProps.HandleMyEvent="someHandler">...</Border>
Here is the code behind for the control that contains the Border element:
public class MyPage : Page{
public void someHandler(object se...
I have a WPF UserControl containing a custom DependencyProperty named MyDP. I want to bind this to a property on my ViewModel (which is injected as the UserControl's DataContext). I know one way to do it by setting the binding in the UserControl's declaration in the parent window's XAML as such:
<Window x:Class="MyNamespace.Views.Main...
I've got a subclassed UserControl that is the content for my main window. I added a DepedencyProperty to my usercontrol, of type ResizeMode, and the PropertyChanged callback sets the ResizeMode of the main window to the value correctly. It runs fine. I can set it from the code behind, or from the XAML, and it works correctly.
However, w...
In WPF, what, really, does it mean to be a "dependency property"?
I read Microsoft's Dependency Properties Overview, but it's not really sinking in for me. In part that article says:
Styles and templates are two of the chief motivating scenarios for using dependency properties. Styles are particularly useful for setting properties...
Hi.
I have the following code XAML code.
<Grid>
<code:TSScrollViewer x:Name="scrollViewer" Zoomer="{Binding ElementName=zoomer}">
<code:DesignerCanvas x:Name="designerCanvas" Background="white" />
</code:TSScrollViewer>
<code:TSZoomer x:Name="zoomer" Grid.Row="0" Grid.Column="1" ControlToZoom={Binding ElementName=d...
I have a UserControl that contains - among other things - a ListView. The ListView has a different data context than the UserControl (this data context is not exposed). If someone consumes my control, I would like them to be able to (indirectly) bind to the ListView's ItemsSource dependency property. It should really feel like the use...