Click here to Skip to main content
15,888,113 members
Home / Discussions / WPF
   

WPF

 
QuestionUserControl Pin
Kevin Marois5-Dec-16 11:02
professionalKevin Marois5-Dec-16 11:02 
AnswerRe: UserControl Pin
Jon McKee5-Dec-16 11:12
professionalJon McKee5-Dec-16 11:12 
GeneralRe: UserControl Pin
Kevin Marois5-Dec-16 11:22
professionalKevin Marois5-Dec-16 11:22 
GeneralRe: UserControl Pin
Jon McKee5-Dec-16 11:40
professionalJon McKee5-Dec-16 11:40 
GeneralRe: UserControl Pin
Kevin Marois5-Dec-16 11:46
professionalKevin Marois5-Dec-16 11:46 
GeneralRe: UserControl Pin
Jon McKee5-Dec-16 11:56
professionalJon McKee5-Dec-16 11:56 
AnswerRe: UserControl Pin
Gerry Schmitz5-Dec-16 11:29
mveGerry Schmitz5-Dec-16 11:29 
GeneralRe: UserControl Pin
Meshack Musundi5-Dec-16 22:23
professionalMeshack Musundi5-Dec-16 22:23 
In a chess app I wrote some time back: WPF: P2P Chess[^], I took an approach similar to what you're doing. I had a bunch of user controls to represent the pieces. Over time I grew uncomfortable with this and decided to take an MVVM friendly approach for an app I'm currently developing, where the user plays against Stockfish. The chess board in my current app is a ListBox whose ItemsPanel is a Grid with eight row and eight columns. The ItemsSource property of the ListBox is bound to a collection of objects that implement the same interface. The collection, in the View Model, is made up of BoardSquares and ChessPieces. The DataTemplate of the ListBox is an Image that uses MultiDataTriggers to determine the appropriate image to display depending on the type of object. I'll be posting an article soon, maybe tommorrow, where you can dig deeper into the code.
"As beings of finite lifespan, our contributions to the sum of human knowledge is one of the greatest endeavors we can undertake and one of the defining characteristics of humanity itself"

GeneralRe: UserControl Pin
Kevin Marois6-Dec-16 4:49
professionalKevin Marois6-Dec-16 4:49 
GeneralRe: UserControl Pin
Meshack Musundi6-Dec-16 5:04
professionalMeshack Musundi6-Dec-16 5:04 
AnswerRe: UserControl Pin
Richard Deeming6-Dec-16 2:10
mveRichard Deeming6-Dec-16 2:10 
GeneralRe: UserControl Pin
Kevin Marois6-Dec-16 4:47
professionalKevin Marois6-Dec-16 4:47 
QuestionC# WPF listbox binding to selected item does not update my property Pin
Member 128805954-Dec-16 5:54
Member 128805954-Dec-16 5:54 
AnswerRe: C# WPF listbox binding to selected item does not update my property Pin
Richard Deeming5-Dec-16 1:58
mveRichard Deeming5-Dec-16 1:58 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Member 128805955-Dec-16 9:08
Member 128805955-Dec-16 9:08 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Jon McKee5-Dec-16 10:59
professionalJon McKee5-Dec-16 10:59 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Member 128805956-Dec-16 7:38
Member 128805956-Dec-16 7:38 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Jon McKee6-Dec-16 8:23
professionalJon McKee6-Dec-16 8:23 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Member 128805956-Dec-16 9:10
Member 128805956-Dec-16 9:10 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Jon McKee6-Dec-16 10:30
professionalJon McKee6-Dec-16 10:30 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Member 128805957-Dec-16 8:10
Member 128805957-Dec-16 8:10 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Jon McKee5-Dec-16 10:13
professionalJon McKee5-Dec-16 10:13 
AnswerRe: C# WPF listbox binding to selected item does not update my property Pin
Gerry Schmitz5-Dec-16 5:51
mveGerry Schmitz5-Dec-16 5:51 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Member 128805955-Dec-16 9:10
Member 128805955-Dec-16 9:10 
QuestionTabControl views are not disposed Pin
Leif Simon Goodwin23-Nov-16 4:55
Leif Simon Goodwin23-Nov-16 4:55 

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.