test;binding;str;types;xaml;xml;⎕USING
⎕USING←'System.IO'
⎕USING,←⊂'System'
⎕USING,←⊂'System.Windows.Markup'
⎕USING,←⊂'System.Xml,system.xml.dll'
⎕USING,←⊂'System.Windows.Controls,WPF/PresentationFramework.dll'
xaml←'<Window '
xaml,←' xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"'
xaml,←' xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" '
xaml,←' xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"'
xaml,←' xmlns:local="clr-namespace:testlibrary" '
xaml,←' Title="Window" Height="300" Width="300"> '
xaml,←' <Grid > '
xaml,←' <StackPanel DataContext="{Binding MyValues}"> '
xaml,←' <TextBox Text="{Binding TextValue, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></TextBox> '
xaml,←' </StackPanel> '
xaml,←' </Grid> '
xaml,←'</Window>'
str←⎕NEW StringReader(⊂xaml)
xml←⎕NEW XmlTextReader str
win←XamlReader.Load xml
props←⎕NS''
props.MyValues←⎕NS''
props.MyValues.TextValue←'this is working'
binding←(2015⌶)'props'
win.DataContext←binding
win.Show
refreshBind ra
props.MyValues.TextValue←ra
Then if you execute the function 'test' you get a WPF window as expected with the TextBox text as: 'this is working'. After that if you execute the function 'refreshBind' you can change the value of the TextBox as expected. But if you try to refresh the namespace with 'refreshBind&' from another thread it is not working. Is there a way to make this work ?
test
refreshBind 'this is working'
refreshBind& 'this is NOT working'
Thanks in advance,
Pierre Gilbert