Click here to Skip to main content
15,916,371 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF TreeView Problem Pin
Kevin Marois17-Oct-12 5:10
professionalKevin Marois17-Oct-12 5:10 
QuestionWPF Datagrid grouping with dynamic columns Pin
Member 93422189-Oct-12 20:45
Member 93422189-Oct-12 20:45 
AnswerRe: WPF Datagrid grouping with dynamic columns Pin
Mycroft Holmes14-Oct-12 15:35
professionalMycroft Holmes14-Oct-12 15:35 
QuestionUsing the ComponentResourceKey Pin
ElPicoso9-Oct-12 8:21
ElPicoso9-Oct-12 8:21 
QuestionSilvelight : Canvas with checkbox create in dynamically like theater sit booking Pin
Shaikh Daniyal9-Oct-12 3:06
professionalShaikh Daniyal9-Oct-12 3:06 
AnswerRe: Silvelight : Canvas with checkbox create in dynamically like theater sit booking Pin
Pete O'Hanlon9-Oct-12 3:11
mvePete O'Hanlon9-Oct-12 3:11 
QuestionByte[] of PDF into image Pin
GomathiR9-Oct-12 2:43
GomathiR9-Oct-12 2:43 
AnswerRe: Byte[] of PDF into image Pin
Pete O'Hanlon9-Oct-12 2:57
mvePete O'Hanlon9-Oct-12 2:57 
GeneralRe: Byte[] of PDF into image Pin
GomathiR9-Oct-12 21:23
GomathiR9-Oct-12 21:23 
GeneralRe: Byte[] of PDF into image Pin
Pete O'Hanlon9-Oct-12 21:51
mvePete O'Hanlon9-Oct-12 21:51 
GeneralRe: Byte[] of PDF into image Pin
GomathiR10-Oct-12 4:22
GomathiR10-Oct-12 4:22 
QuestionSL application tha treads local registries Pin
picasso25-Oct-12 18:51
picasso25-Oct-12 18:51 
AnswerRe: SL application tha treads local registries Pin
Richard MacCutchan5-Oct-12 22:37
mveRichard MacCutchan5-Oct-12 22:37 
QuestionHow to dynamically load Theme in Application? Pin
Savalia Manoj M4-Oct-12 1:27
Savalia Manoj M4-Oct-12 1:27 
AnswerRe: How to dynamically load Theme in Application? Pin
Pete O'Hanlon4-Oct-12 1:55
mvePete O'Hanlon4-Oct-12 1:55 
AnswerRe: How to dynamically load Theme in Application? Pin
Shrinivas Ramesh Ambat17-Oct-12 2:38
Shrinivas Ramesh Ambat17-Oct-12 2:38 
GeneralRe: How to dynamically load Theme in Application? Pin
Pete O'Hanlon17-Oct-12 3:07
mvePete O'Hanlon17-Oct-12 3:07 
GeneralRe: How to dynamically load Theme in Application? Pin
Wayne Gaylard17-Oct-12 3:10
professionalWayne Gaylard17-Oct-12 3:10 
QuestionProblem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj3-Oct-12 20:19
Hossein Khalaj3-Oct-12 20:19 
AnswerRe: Problem in flow direction when value is right to left in Telerik Pin
Pete O'Hanlon3-Oct-12 20:21
mvePete O'Hanlon3-Oct-12 20:21 
GeneralRe: Problem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj3-Oct-12 20:23
Hossein Khalaj3-Oct-12 20:23 
GeneralRe: Problem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj4-Oct-12 22:48
Hossein Khalaj4-Oct-12 22:48 
Questionbinding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
dominioYP3-Oct-12 0:25
dominioYP3-Oct-12 0:25 
hello
My program has a ListView, which is connected to an ObservableCollection.
If I add values ​​to the ObservableCollection, I can see them in the ListView.
But if I change an object in the ObservableCollection, the change is not seen in the ListView. The modification is made by changing the name in the textbox side and clicking the "CAMBIA"




XML
<Window x:Class="WpfApplication3.bindingListBoxTOstring"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="bindingListV" Height="300" Width="300"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        >
    <Grid>


        <ListView Name="lv" ItemsSource="{Binding ListBoxCollection, UpdateSourceTrigger=PropertyChanged}" Margin="12,0,128,50" SelectionChanged="lv_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="profilo" Width="200" 
                                            DisplayMemberBinding="{Binding nome, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                </GridView>
            </ListView.View>
        </ListView>
        <Label Content="Cambia valore" Height="28" HorizontalAlignment="Left" Margin="164,23,0,0" Name="label1" VerticalAlignment="Top" Width="102" />
        <TextBox Height="32" HorizontalAlignment="Left" Margin="154,56,0,0" Name="textBox1" VerticalAlignment="Top" Width="114" />
        <Button Content="cambia" Height="23" HorizontalAlignment="Left" Margin="177,107,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
    </Grid>
</Window>



C#
namespace WpfApplication3
{
    public partial class bindingListBoxTOstring : Window
    {
        
        ObservableCollection<ListBoxData> _ListBoxCollection =
            new ObservableCollection<ListBoxData>();



        public bindingListBoxTOstring()
        {
            InitializeComponent();
            //DataContext = this;
            _ListBoxCollection.Add(new ListBoxData { nome = "netgear" });
            _ListBoxCollection.Add(new ListBoxData { nome = "alice13" });
        }


        public ObservableCollection<ListBoxData> ListBoxCollection
        { get { return _ListBoxCollection; } }

        public class ListBoxData
        {
            public string nome { get; set; }
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ListBoxData x = lv.SelectedItem as ListBoxData;
            x.nome = (textBox1.Text) != string.Empty ? (textBox1.Text) : string.Empty ;
        }

        private void lv_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBoxData x = lv.SelectedItem as ListBoxData;
            textBox1.Text = x.nome;
        }
    }
}

AnswerRe: binding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
Pete O'Hanlon3-Oct-12 0:54
mvePete O'Hanlon3-Oct-12 0:54 
GeneralRe: binding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
dominioYP3-Oct-12 22:24
dominioYP3-Oct-12 22:24 

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.