Click here to Skip to main content
15,896,512 members
Home / Discussions / WPF
   

WPF

 
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 
AnswerRe: Bind an attached property Pin
ABitSmart11-Mar-09 16:57
ABitSmart11-Mar-09 16:57 
QuestionRe: Bind an attached property Pin
Pauwels Bart11-Mar-09 19:45
Pauwels Bart11-Mar-09 19:45 
The converter only gets called when the program starts. GetSCOLOR never gets called. The biggest problem is that I don't exactly know how to bind an attached property so I guess that is the problem. I don't get any errors.

Annotation is a control that I wrote to contain graphics (rectangles, circles, ... drawn by the user). That control gets added to a canvas (nsifCanvas) multiple times. Every annotation control has the property SCOLOR (so some can be monochrome and other can contain colors). That is the reason why I use an attached property. When I click on an annotation, that one gets active and depending on the property, a button in a toolbar must be enabled (if the annotation can contain colors) or disabled (monochrome annotation).

Next is a part of the XAML code. In nsifCanvas the user can add Images and also Annotations (the control where the user can add graphics). Everything works except the binding to the attached property.


<Grid>
<DockPanel>
<!-- Add toolbar tray to window -->
<ToolBarTray DockPanel.Dock="Top" Orientation="Horizontal" IsLocked="False">

<!-- tbTools -->
<ToolBar Name="tbTools" Band="1" BandIndex="1">
<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>

</ToolBar>
</ToolBarTray>

<!-- Window -->
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<controls:NSIFCanvas x:Name="nsifCanvas" Background="LightGray">
<!-- Add children in code to populate canvas -->
</controls:NSIFCanvas>
</ScrollViewer>
</DockPanel>
</Grid>



So, I guess I am correct to use an attached property? And if it is correct, does anybody has an example how to bind it? I guess the binding needs to contact the Get function but like I said, the way I do it now, the program doesn't get there. The elementname in the binding is nsifCanvas. nsifCanvas contains the property but the property depends on the annotation control that is a child of that canvas.

I hope someone has an example or something.
Thx
AnswerRe: Bind an attached property Pin
ABitSmart11-Mar-09 21:00
ABitSmart11-Mar-09 21:00 
QuestionRe: Bind an attached property Pin
Pauwels Bart11-Mar-09 22:33
Pauwels Bart11-Mar-09 22:33 
AnswerRe: Bind an attached property Pin
ABitSmart11-Mar-09 23:13
ABitSmart11-Mar-09 23:13 
GeneralRe: Bind an attached property Pin
Pauwels Bart12-Mar-09 0:54
Pauwels Bart12-Mar-09 0:54 
QuestionCan a WPF browser app be hosted on a server and accessed multiply by other users Pin
DimitarS10-Mar-09 21:56
DimitarS10-Mar-09 21:56 
AnswerRe: Can a WPF browser app be hosted on a server and accessed multiply by other users Pin
Pete O'Hanlon10-Mar-09 22:34
mvePete O'Hanlon10-Mar-09 22:34 
GeneralRe: Can a WPF browser app be hosted on a server and accessed multiply by other users Pin
DimitarS10-Mar-09 22:36
DimitarS10-Mar-09 22:36 
QuestionDecoupling WCF client proxy Pin
Mark J. Miller10-Mar-09 14:02
Mark J. Miller10-Mar-09 14:02 
QuestionTreeView vertical scrollbar bug Pin
Steve The Plant10-Mar-09 10:26
Steve The Plant10-Mar-09 10:26 
AnswerRe: TreeView vertical scrollbar bug Pin
ABitSmart10-Mar-09 17:23
ABitSmart10-Mar-09 17:23 
GeneralRe: TreeView vertical scrollbar bug Pin
Steve The Plant11-Mar-09 12:45
Steve The Plant11-Mar-09 12:45 
GeneralRe: TreeView vertical scrollbar bug Pin
Pete O'Hanlon11-Mar-09 22:26
mvePete O'Hanlon11-Mar-09 22:26 
GeneralRe: TreeView vertical scrollbar bug Pin
Steve The Plant12-Mar-09 3:51
Steve The Plant12-Mar-09 3:51 
QuestionBinding Radio button group with collection object Pin
gsdeepak10-Mar-09 4:41
gsdeepak10-Mar-09 4:41 
AnswerRe: Binding Radio button group with collection object Pin
Pete O'Hanlon10-Mar-09 5:08
mvePete O'Hanlon10-Mar-09 5:08 
QuestionNavigation in Window Pin
GomathiR9-Mar-09 21:21
GomathiR9-Mar-09 21:21 
AnswerRe: Navigation in Window Pin
ABitSmart9-Mar-09 22:42
ABitSmart9-Mar-09 22:42 

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.