मैं एक छोटे से खर्च पर एक दिन पर इस समस्या है और मैं बिल्कुल अनजान है । अगर मैं के लिए बटन क्लिक करें शो के दूसरे दृश्य खोलता है, लेकिन सामग्री के बिना. मैं भी एक ब्रेकप्वाइंट में देखें मॉडल. इस के लिए मैं कम कर दिया है सब कुछ करने के लिए एक सरल पाठ बॉक्स और Textblock है कि प्रदर्शन एक ही डेटा है, लेकिन वे नहीं है. वे दिखाने के लिए कुछ भी नहीं है, के बाद भी टाइपिंग बॉक्स में ब्लॉक अद्यतन नहीं करता है. लेकिन क्या कभी मैं कोशिश Databinding काम नहीं करता है. किसी को भी एक विचार है?
धन्यवाद अग्रिम में
मेरी दूसरी देखें
<Window x:Class="AoE4_BO_Overlay.Views.EditorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:AoE4_BO_Overlay.Views" xmlns:viewmodels="clr-namespace:AoE4_BO_Overlay.ViewModels" d:DataContext="{d:DesignInstance Type=viewmodels:EditorViewModel}"
mc:Ignorable="d"
Title="EditorView" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<TextBlock Text="{Binding Path=FirstName}" Grid.Column="0" Grid.Row="2"/>
<TextBox Text="{Binding Path=FirstName , Mode=OneWay}" Grid.Column="0" Grid.Row="1"/>
</Grid>
मेरे ViewModel
internal class EditorViewModel : Conductor<object>
{
private string _firstName = "Tom";
public EditorViewModel()
{
}
public string FirstName
{
get
{
return _firstName;
}
set
{
_firstName = value;
NotifyOfPropertyChange(() => FirstName);
}
}
}
कैसे मैं उन दोनों के
public void CreateBO_Click(object sender, RoutedEventArgs e)
{
EditorView createBO = new EditorView();
ActivateItemAsync(new EditorViewModel());
createBO.Show();
}
जानकारी जोड़ा गया
public partial class EditorView : Window
{
public EditorView()
{
DataContext = new EditorViewModel();
InitializeComponent();
}
}