Click here to Skip to main content
11,431,483 members (70,664 online)

Silverlight / WPF

 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy30-Jan-13 3:40
memberdevvvy30-Jan-13 3:40 
GeneralRe: RoutedEvent vs AttachedEvent Pin
Pete O'Hanlon30-Jan-13 3:44
protectorPete O'Hanlon30-Jan-13 3:44 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy30-Jan-13 4:08
memberdevvvy30-Jan-13 4:08 
QuestionWPF Tab Item Close Button [modified] Pin
Kevin Marois29-Jan-13 19:03
memberKevin Marois29-Jan-13 19:03 
AnswerRe: WPF Tab Item Close Button Pin
SledgeHammer0129-Jan-13 20:02
memberSledgeHammer0129-Jan-13 20:02 
GeneralRe: WPF Tab Item Close Button Pin
Kevin Marois2-Feb-13 16:33
memberKevin Marois2-Feb-13 16:33 
GeneralRe: WPF Tab Item Close Button Pin
SledgeHammer012-Feb-13 19:25
memberSledgeHammer012-Feb-13 19:25 
QuestionCustom Control Template for beginners Pin
jeffdavis870329-Jan-13 10:12
memberjeffdavis870329-Jan-13 10: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 12:32
memberSledgeHammer0129-Jan-13 12:32 
GeneralRe: Custom Control Template for beginners Pin
jeffdavis870329-Jan-13 13:10
memberjeffdavis870329-Jan-13 13:10 
GeneralRe: Custom Control Template for beginners Pin
SledgeHammer0129-Jan-13 13:46
memberSledgeHammer0129-Jan-13 13:46 
GeneralTreeview Selection Pin
vijilvs11629-Jan-13 0:03
membervijilvs11629-Jan-13 0:03 
QuestionProblem With TreeViewItem Tooltip [modified] Pin
Kevin Marois26-Jan-13 16:39
memberKevin Marois26-Jan-13 16:39 
GeneralRe: Problem With TreeViewItem Tooltip Pin
Thomas Duwe29-Jan-13 2:46
memberThomas Duwe29-Jan-13 2:46 
QuestionHow to get a value from treeview. Pin
boryborawski26-Jan-13 13:06
memberboryborawski26-Jan-13 13:06 
QuestionConstant header and footer Pin
columbos1492726-Jan-13 0:11
membercolumbos1492726-Jan-13 0:11 
AnswerRe: Constant header and footer Pin
Richard MacCutchan26-Jan-13 1:05
mvpRichard MacCutchan26-Jan-13 1:05 
QuestionWPF.MDI Pin
columbos1492725-Jan-13 9:37
membercolumbos1492725-Jan-13 9:37 
AnswerRe: WPF.MDI Pin
Abhishek Pant25-Jan-13 10:29
memberAbhishek Pant25-Jan-13 10:29 
GeneralRe: WPF.MDI Pin
columbos1492725-Jan-13 23:11
membercolumbos1492725-Jan-13 23:11 
GeneralRe: WPF.MDI Pin
Abhishek Pant25-Jan-13 23:33
memberAbhishek Pant25-Jan-13 23:33 
AnswerRe: WPF.MDI Pin
tram730-Nov-13 6:54
membertram730-Nov-13 6:54 
QuestionSilverlight Dispatcher.BeginInvoke not allow thread to run more then one time [modified] Pin
Steve Holdorf24-Jan-13 13:13
memberSteve Holdorf24-Jan-13 13:13 
AnswerRe: Silverlight Dispatcher.BeginInvoke not allow thread to run more then one time Pin
db7uk26-Jan-13 14:11
memberdb7uk26-Jan-13 14:11 
GeneralRe: Silverlight Dispatcher.BeginInvoke not allow thread to run more then one time [modified] Pin
Steve Holdorf27-Jan-13 4:19
memberSteve Holdorf27-Jan-13 4: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
Web01 | 2.8.150428.2 | Last Updated 22 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid