Click here to Skip to main content
       

Silverlight / WPF

 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 2:40 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 2:44 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 3:08 
QuestionWPF Tab Item Close Button [modified] PinmemberKevin Marois29-Jan-13 18:03 
AnswerRe: WPF Tab Item Close Button PinmemberSledgeHammer0129-Jan-13 19:02 
GeneralRe: WPF Tab Item Close Button PinmemberKevin Marois2-Feb-13 15:33 
GeneralRe: WPF Tab Item Close Button PinmemberSledgeHammer012-Feb-13 18:25 
QuestionCustom Control Template for beginners Pinmemberjeffdavis870329-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 PinmemberSledgeHammer0129-Jan-13 11:32 
GeneralRe: Custom Control Template for beginners Pinmemberjeffdavis870329-Jan-13 12:10 
GeneralRe: Custom Control Template for beginners PinmemberSledgeHammer0129-Jan-13 12:46 
GeneralTreeview Selection Pinmembervijilvs11628-Jan-13 23:03 
QuestionProblem With TreeViewItem Tooltip [modified] PinmemberKevin Marois26-Jan-13 15:39 
GeneralRe: Problem With TreeViewItem Tooltip PinmemberThomas Duwe29-Jan-13 1:46 
QuestionHow to get a value from treeview. Pinmemberboryborawski26-Jan-13 12:06 
QuestionConstant header and footer Pinmembercolumbos1492725-Jan-13 23:11 
AnswerRe: Constant header and footer PinmvpRichard MacCutchan26-Jan-13 0:05 
QuestionWPF.MDI Pinmembercolumbos1492725-Jan-13 8:37 
AnswerRe: WPF.MDI PinmemberAbhishek Pant25-Jan-13 9:29 
GeneralRe: WPF.MDI Pinmembercolumbos1492725-Jan-13 22:11 
GeneralRe: WPF.MDI PinmemberAbhishek Pant25-Jan-13 22:33 
AnswerRe: WPF.MDI Pinmembertram730-Nov-13 5:54 
QuestionSilverlight Dispatcher.BeginInvoke not allow thread to run more then one time [modified] PinmemberSteve Holdorf24-Jan-13 12:13 
AnswerRe: Silverlight Dispatcher.BeginInvoke not allow thread to run more then one time Pinmemberdb7uk26-Jan-13 13:11 
GeneralRe: Silverlight Dispatcher.BeginInvoke not allow thread to run more then one time [modified] PinmemberSteve Holdorf27-Jan-13 3:19 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 18 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid