Click here to Skip to main content
15,923,087 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to load only needed images? Pin
Luc Pattyn13-Mar-09 2:19
sitebuilderLuc Pattyn13-Mar-09 2:19 
GeneralRe: How to load only needed images? [modified] Pin
S.a.n.4.e.s14-Mar-09 0:10
S.a.n.4.e.s14-Mar-09 0:10 
QuestionStoring Signature in sql server database Pin
vsaratkar12-Mar-09 5:45
vsaratkar12-Mar-09 5:45 
AnswerRe: Storing Signature in sql server database Pin
Eslam Afifi12-Mar-09 13:00
Eslam Afifi12-Mar-09 13:00 
GeneralRe: Storing Signature in sql server database Pin
vsaratkar13-Mar-09 2:13
vsaratkar13-Mar-09 2:13 
GeneralRe: Storing Signature in sql server database Pin
Eslam Afifi13-Mar-09 2:58
Eslam Afifi13-Mar-09 2:58 
GeneralRe: Storing Signature in sql server database Pin
AndyTexas22-Jun-09 6:08
AndyTexas22-Jun-09 6:08 
GeneralRe: Storing Signature in sql server database Pin
Eslam Afifi22-Jun-09 12:24
Eslam Afifi22-Jun-09 12:24 
QuestionWPF Tween Library Pin
emptythetill12-Mar-09 1:56
emptythetill12-Mar-09 1:56 
AnswerRe: WPF Tween Library Pin
Pete O'Hanlon12-Mar-09 2:25
mvePete O'Hanlon12-Mar-09 2:25 
GeneralRe: WPF Tween Library Pin
emptythetill13-Mar-09 2:50
emptythetill13-Mar-09 2:50 
QuestionWorking with 3D models created in Blender Pin
Etienne_12312-Mar-09 0:11
Etienne_12312-Mar-09 0:11 
AnswerRe: Working with 3D models created in Blender Pin
Pete O'Hanlon12-Mar-09 0:27
mvePete O'Hanlon12-Mar-09 0:27 
QuestionWPF: How to make resizing custom datagrid column? [modified] Pin
MichalDawn11-Mar-09 22:58
MichalDawn11-Mar-09 22:58 
AnswerRe: WPF: How to make resizing custom datagrid column? Pin
ABitSmart11-Mar-09 23:40
ABitSmart11-Mar-09 23:40 
GeneralRe: WPF: How to make resizing custom datagrid column? Pin
MichalDawn11-Mar-09 23:51
MichalDawn11-Mar-09 23:51 
GeneralRe: WPF: How to make resizing custom datagrid column? Pin
ABitSmart11-Mar-09 23:53
ABitSmart11-Mar-09 23:53 
GeneralRe: WPF: How to make resizing custom datagrid column? [modified] Pin
MichalDawn12-Mar-09 0:02
MichalDawn12-Mar-09 0:02 
QuestionHow to render pixels of a bitmap correctly? Pin
Andy@11-Mar-09 5:03
Andy@11-Mar-09 5:03 
AnswerRe: How to render pixels of a bitmap correctly? Pin
Insincere Dave11-Mar-09 16:14
Insincere Dave11-Mar-09 16:14 
GeneralRe: How to render pixels of a bitmap correctly? Pin
Andy@12-Mar-09 2:59
Andy@12-Mar-09 2:59 
GeneralRe: How to render pixels of a bitmap correctly? Pin
Insincere Dave12-Mar-09 6:56
Insincere Dave12-Mar-09 6:56 
GeneralRe: How to render pixels of a bitmap correctly? Pin
Andy@17-Mar-09 4:20
Andy@17-Mar-09 4:20 
QuestionBind an attached property Pin
Pauwels Bart11-Mar-09 3:55
Pauwels Bart11-Mar-09 3:55 
Hi,

I'm trying to bind an own made attached property but I can't get it to work. I know how to do it with a normal dependency property and I have found help on the internet that concerns canvas attached properties but that isn't exactly what I need.

XAML code:


<Button Tooltip="Edge Color" IsEnabled="{Binding Path=(SCOLOR), ElementName=nsifCanvas, Mode=OneWay, Converter={StaticResource convGraphicColour}}">
<Image Source="Resources\Icons\LineColorHS.png" Style="{StaticResource IconStyle}"/>
</Button>



Next is my attached property. The value in it comes from an enum "GraphicColour". That enum just contains 2 values (for the moment) that defines the kind of colorscheme a graphic has: C (colored) and M (monochrome). I want that a button on my GUI gets disabled if I select a "graphic" (actually a UIElement) that is monochrome (value "M"). When the value is "C", the button must be enabled so the user can select a color. So I want that the button gets enabled or disables depending on the graphic I have selected at the moment. With the code I have now, the button just stays disabled! The converter in XAML converts the enum value to a boolean (true if graphic can contain colors, else false).


/// <summary>
/// Graphic color.
/// </summary>
public static readonly DependencyProperty SCOLORProperty;

/// <summary>
/// Get graphic SCOLOR.
/// </summary>
public static GraphicColour GetSCOLOR(Annotation graphic)
{
return (GraphicColour)graphic.GetValue(SCOLORProperty);
}

/// <summary>
/// Set graphic SCOLOR.
/// </summary>
public static void SetSCOLOR(Annotation graphic, GraphicColour value)
{
graphic.SetValue(SCOLORProperty, value);
}

static NSIFCanvas()
{
SCOLORProperty = DependencyProperty.RegisterAttached(
"SCOLOR",
typeof(GraphicColour),
typeof(NSIFCanvas),
new PropertyMetadata(GraphicColour.M));
}



I have no idea how to connect the enable propertie of the button to that attached property of the graphic selected on the moment. Is this possible and do you maybe have an example? (I can set and get the property value in code for a certain graphic.)

Thanks!
AnswerRe: Bind an attached property Pin
ABitSmart11-Mar-09 16:57
ABitSmart11-Mar-09 16:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.