Click here to Skip to main content
15,881,588 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy30-Jan-13 2:40
devvvy30-Jan-13 2:40 
GeneralRe: RoutedEvent vs AttachedEvent Pin
Pete O'Hanlon30-Jan-13 2:44
mvePete O'Hanlon30-Jan-13 2:44 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy30-Jan-13 3:08
devvvy30-Jan-13 3:08 
QuestionWPF Tab Item Close Button Pin
Kevin Marois29-Jan-13 18:03
professionalKevin Marois29-Jan-13 18:03 
AnswerRe: WPF Tab Item Close Button Pin
SledgeHammer0129-Jan-13 19:02
SledgeHammer0129-Jan-13 19:02 
GeneralRe: WPF Tab Item Close Button Pin
Kevin Marois2-Feb-13 15:33
professionalKevin Marois2-Feb-13 15:33 
GeneralRe: WPF Tab Item Close Button Pin
SledgeHammer012-Feb-13 18:25
SledgeHammer012-Feb-13 18:25 
QuestionCustom Control Template for beginners Pin
jeffdavis870329-Jan-13 9:12
jeffdavis870329-Jan-13 9:12 
I am new to WPF applications. I come from a VB6 Windows Forms background. I used to create user controls that I used in UI's to create graphic content controls like buttons with normal, down,and hover images. While I know the ultimate way to do this is create a separate project for my custom controls I am just working withing a single project to get things worked out first.

I have created a Controls folder where I have added several custom controls each inherting from a base control like Button, RadioButton, Slider, Checkbox etc. I can then add properties to each custom control for DefaultImage, DownImage, HoverImage and in the case of a Slider GripImage and GutterImage. The properties have a public set/get property so I can set the images for a specific control and then the control behavior can set the proper image.

There is an Images folder where I put all the images needed for the application.

I have created a Images.xaml ResourceDictionary that defines key names like ButtonDown to the specific image names so the image naming in the template is easier and I can swap out images easily.

A Generic.xaml gets created in the Themes folder where the basic Control Template goes. Not sure if this is best practice for storing each Control Template or not but it is what gets created by default.

My main area of difficulty is creating the template. I know what I want to do but can't get the syntax to work correctly.

In the case of the custom button I want to create triggers for IsPressed and IsMouseOver and set the controls Background ImageBrush to the proper image. When those triggers are false I want to set the background image to the DefaultImage

I'm not sure about the syntax for refering to the image property of the custom Control and how best to access it in the xamal.

I've looked at a lot of examples but none seem to do things the way I am organizing it. I don't want to hard code the images to the control. My ultimate goal is to be able to drag the custom control into a grid using the designer and set the Default, Down, and Hover image properties and then place the control how I want it in the designer. Then if I want to change the entire look of the app I can just swap out images in the Images folder and the GUI will change.
AnswerRe: Custom Control Template for beginners Pin
SledgeHammer0129-Jan-13 11:32
SledgeHammer0129-Jan-13 11:32 
GeneralRe: Custom Control Template for beginners Pin
jeffdavis870329-Jan-13 12:10
jeffdavis870329-Jan-13 12:10 
GeneralRe: Custom Control Template for beginners Pin
SledgeHammer0129-Jan-13 12:46
SledgeHammer0129-Jan-13 12:46 
GeneralTreeview Selection Pin
vijilvs11628-Jan-13 23:03
vijilvs11628-Jan-13 23:03 
QuestionProblem With TreeViewItem Tooltip Pin
Kevin Marois26-Jan-13 15:39
professionalKevin Marois26-Jan-13 15:39 
GeneralRe: Problem With TreeViewItem Tooltip Pin
Thomas Duwe29-Jan-13 1:46
Thomas Duwe29-Jan-13 1:46 
QuestionHow to get a value from treeview. Pin
boryborawski26-Jan-13 12:06
boryborawski26-Jan-13 12:06 
QuestionConstant header and footer Pin
columbos1492725-Jan-13 23:11
columbos1492725-Jan-13 23:11 
AnswerRe: Constant header and footer Pin
Richard MacCutchan26-Jan-13 0:05
mveRichard MacCutchan26-Jan-13 0:05 
QuestionWPF.MDI Pin
columbos1492725-Jan-13 8:37
columbos1492725-Jan-13 8:37 
AnswerRe: WPF.MDI Pin
Abhishek Pant25-Jan-13 9:29
professionalAbhishek Pant25-Jan-13 9:29 
GeneralRe: WPF.MDI Pin
columbos1492725-Jan-13 22:11
columbos1492725-Jan-13 22:11 
GeneralRe: WPF.MDI Pin
Abhishek Pant25-Jan-13 22:33
professionalAbhishek Pant25-Jan-13 22:33 
AnswerRe: WPF.MDI Pin
tram730-Nov-13 5:54
tram730-Nov-13 5:54 
QuestionSilverlight Dispatcher.BeginInvoke not allow thread to run more then one time Pin
Steve Holdorf24-Jan-13 12:13
Steve Holdorf24-Jan-13 12:13 
AnswerRe: Silverlight Dispatcher.BeginInvoke not allow thread to run more then one time Pin
db7uk26-Jan-13 13:11
db7uk26-Jan-13 13:11 
GeneralRe: Silverlight Dispatcher.BeginInvoke not allow thread to run more then one time Pin
Steve Holdorf27-Jan-13 3:19
Steve Holdorf27-Jan-13 3:19 

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.