Click here to Skip to main content
15,886,067 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF MVVM Pin
Richard MacCutchan24-Oct-09 23:08
mveRichard MacCutchan24-Oct-09 23:08 
QuestionMVVM newbie question - showing OpenFileDialog? Pin
Judah Gabriel Himango24-Oct-09 14:33
sponsorJudah Gabriel Himango24-Oct-09 14:33 
AnswerRe: MVVM newbie question - showing OpenFileDialog? Pin
Pete O'Hanlon25-Oct-09 9:36
mvePete O'Hanlon25-Oct-09 9:36 
GeneralRe: MVVM newbie question - showing OpenFileDialog? Pin
Judah Gabriel Himango25-Oct-09 16:01
sponsorJudah Gabriel Himango25-Oct-09 16:01 
GeneralRe: MVVM newbie question - showing OpenFileDialog? Pin
Pete O'Hanlon25-Oct-09 22:05
mvePete O'Hanlon25-Oct-09 22:05 
QuestionWpf Pin
miralireza24-Oct-09 8:44
miralireza24-Oct-09 8:44 
AnswerRe: Wpf Pin
Pete O'Hanlon24-Oct-09 9:13
mvePete O'Hanlon24-Oct-09 9:13 
QuestionWPF- Databinding set path Pin
DeepakMega23-Oct-09 8:25
DeepakMega23-Oct-09 8:25 
HI, This is a simple one, but i cant get it to work
I have a combobox filled with color names and a small colored rectangle next to the names.
I want to bind this combobox to a text box, such that when a color is selected in combobox, only the color name shows up in the text box. I need to do this programatically, not in xaml

My combobox datatemplate is
<DataTemplate x:Key="ColorText" >
<StackPanel Orientation="Horizontal">
<Rectangle Width="20" Height="28" Fill="{Binding Name}" Stroke="#FF000000"/>
<TextBlock Text ="{Binding Name}" />
</StackPanel>
</DataTemplate>

My current code to bind is

Binding myBinding = new Binding("Text");
myBinding.Source = this.colorTextBox;
myBinding.Mode = BindingMode.Default;
this.comboBox.SetBinding(ComboBox.SelectedItemProperty, myBinding);

But the result i get in text box is "System.Windows.Media.Color Blue" , i need only Blue to appear in the text box.
comboBox.selectedItem object contains 2 types, one is color and other is Name as the datatemplate shows.
Please help me to modify my above binding code , such that the text box shows only the name of the color and not "System.Windows.Media.Color Blue".
These controls(combobox and textbox) are programatically generated.
AnswerRe: WPF- Databinding set path Pin
Ian Shlasko23-Oct-09 8:57
Ian Shlasko23-Oct-09 8:57 
GeneralRe: WPF- Databinding set path Pin
DeepakMega23-Oct-09 16:24
DeepakMega23-Oct-09 16:24 
QuestionRefresh and Browser Close In Silverlight Pin
Member 470467523-Oct-09 3:21
Member 470467523-Oct-09 3:21 
QuestionWPF: WPF Toolkit Datagrid. Capturing Key board events Pin
sameercodes22-Oct-09 23:12
sameercodes22-Oct-09 23:12 
QuestionRe: WPF: WPF Toolkit Datagrid. Capturing Key board events Pin
hhrafn23-Oct-09 5:04
hhrafn23-Oct-09 5:04 
AnswerRe: WPF: WPF Toolkit Datagrid. Capturing Key board events Pin
ausadmin23-Oct-09 14:17
ausadmin23-Oct-09 14:17 
QuestionDelete a control from Cider( WPF editor) through code [modified] Pin
Vinod C S21-Oct-09 23:12
Vinod C S21-Oct-09 23:12 
QuestionWPF DataGrid with DataGridTemplateColumn and RadioButton Pin
ausadmin21-Oct-09 20:51
ausadmin21-Oct-09 20:51 
AnswerRe: WPF DataGrid with DataGridTemplateColumn and RadioButton Pin
Suthagar.p25-Nov-09 21:56
Suthagar.p25-Nov-09 21:56 
QuestionHas anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 8:07
fred_21-Oct-09 8:07 
QuestionRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 8:52
Mark Salsbery21-Oct-09 8:52 
AnswerRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 8:54
fred_21-Oct-09 8:54 
QuestionRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 8:59
Mark Salsbery21-Oct-09 8:59 
AnswerRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:00
fred_21-Oct-09 9:00 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 9:19
Mark Salsbery21-Oct-09 9:19 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:22
fred_21-Oct-09 9:22 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:45
fred_21-Oct-09 9:45 

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.