Click here to Skip to main content
15,911,142 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Silverlight User Control Template was Missing Pin
Michael Sync5-Jun-08 2:24
Michael Sync5-Jun-08 2:24 
QuestionHow to create docking control in silver light 2.0 Pin
kishorekumar.malla@live.com4-Jun-08 16:09
kishorekumar.malla@live.com4-Jun-08 16:09 
AnswerRe: How to create docking control in silver light 2.0 Pin
Michael Sync4-Jun-08 17:30
Michael Sync4-Jun-08 17:30 
QuestionHow to create event handler using visual studio 2008? Pin
katelva3-Jun-08 20:03
katelva3-Jun-08 20:03 
AnswerRe: How to create event handler using visual studio 2008? Pin
Michael Sync4-Jun-08 17:27
Michael Sync4-Jun-08 17:27 
GeneralRe: How to create event handler using visual studio 2008? Pin
katelva17-Jun-08 7:54
katelva17-Jun-08 7:54 
QuestionOdd Color Related Exception Pin
Jammer3-Jun-08 6:44
Jammer3-Jun-08 6:44 
QuestionWPF Button ControlTemplate Pin
koleraba3-Jun-08 1:48
koleraba3-Jun-08 1:48 
Hi!

I am creating a ControlTemplate for a Button. A button gets it's 3D look with BevelBitmapEffect which is applied to the Canvas which holds the controls that are used in the template. I meant to use the HorizontalContentAlignment and VerticalContentAlignment properties of the button to Rotate the button. I also need to change the LightAngle of the BevelBitmapEffect when the button is rotated. Here is an simplified example:

<ControlTemplate x:Key="ArrowBtnTmp" TargetType="{x:Type ButtonBase}">
<Viewbox Stretch="Uniform">
<Canvas Width="136" Height="52">
<Path Width="135.046" SnapsToDevicePixels="True"
Height="51.862"
Fill="{TemplateBinding Background}"
Stretch="Fill"
Canvas.Left="0"
Canvas.Top="0"
Data="..."/>
<Canvas.BitmapEffect>
<BevelBitmapEffect x:Name="BevelEffect" LightAngle="135" />
</Canvas.BitmapEffect>
<Canvas.RenderTransform>
<RotateTransform x:Name="RotateTransform" Angle="0" />
</Canvas.RenderTransform>
</Canvas>
</Viewbox>
<ControlTemplate.Triggers>
<Trigger Property="HorizontalContentAlignment" Value="Right">
<Setter TargetName="BevelEffect" Property="LightAngle" Value="225" />
<Setter TargetName="RotateTransform" Property="Angle" Value="90" />
</Trigger>
<Trigger Property="VerticalContentAlignment" Value="Bottom">
<Setter TargetName="BevelEffect" Property="LightAngle" Value="315" />
<Setter TargetName="RotateTransform" Property="Angle" Value="180" />
</Trigger>
<Trigger Property="HorizontalContentAlignment" Value="Left">
<Setter TargetName="BevelEffect" Property="LightAngle" Value="45" />
<Setter TargetName="RotateTransform" Property="Angle" Value="270" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>


But the example does not work. I get a compile error saying:
Cannot find the trigger target BevelEffect.

Am I missing something, or this is not the right way to solve my problem. Does anybody has a better solution? Any advice will be greatly appreciated!

Uros
AnswerRe: WPF Button ControlTemplate Pin
User 2710094-Jun-08 1:15
User 2710094-Jun-08 1:15 
QuestionUsing Reports in WPF Pin
member272-Jun-08 19:01
member272-Jun-08 19:01 
AnswerRe: Using Crystal Reports in WPF Pin
User 2710093-Jun-08 0:47
User 2710093-Jun-08 0:47 
QuestionMP3 Player Pin
BlitzPackage2-Jun-08 11:32
BlitzPackage2-Jun-08 11:32 
AnswerRe: MP3 Player Pin
User 2710093-Jun-08 0:29
User 2710093-Jun-08 0:29 
QuestionCreating Custom Button control using Asp.Net Pin
VijaySofist1-Jun-08 19:20
VijaySofist1-Jun-08 19:20 
AnswerRe: Creating Custom Button control using Asp.Net Pin
Michael Sync2-Jun-08 18:14
Michael Sync2-Jun-08 18:14 
GeneralRe: Creating Custom Button control using Asp.Net Pin
Michael Sync2-Jun-08 18:15
Michael Sync2-Jun-08 18:15 
QuestionRe: Creating Custom Button control using Asp.Net Pin
VijaySofist3-Jun-08 18:45
VijaySofist3-Jun-08 18:45 
AnswerRe: Creating Custom Button control using Asp.Net Pin
Michael Sync4-Jun-08 20:16
Michael Sync4-Jun-08 20:16 
QuestionRe: Creating Custom Button control using Asp.Net Pin
VijaySofist4-Jun-08 23:59
VijaySofist4-Jun-08 23:59 
AnswerRe: Creating Custom Button control using Asp.Net Pin
Michael Sync5-Jun-08 2:20
Michael Sync5-Jun-08 2:20 
AnswerScaling woes Pin
Ray Hayes1-Jun-08 6:01
Ray Hayes1-Jun-08 6:01 
GeneralRe: Scaling woes Pin
TJoe3-Jun-08 2:22
TJoe3-Jun-08 2:22 
GeneralRe: Scaling woes Pin
Ray Hayes3-Jun-08 11:40
Ray Hayes3-Jun-08 11:40 
GeneralRe: Scaling woes Pin
Ray Hayes3-Jun-08 11:53
Ray Hayes3-Jun-08 11:53 
GeneralRe: Scaling woes Pin
TJoe4-Jun-08 1:56
TJoe4-Jun-08 1:56 

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.