Merhabalar. MVVM mimarisini uygulamaya çalışıyorum. Fakat yapmış olduğum basit bir binding işleminde XAML dosyamda değişiklik göremiyorum. Fakat uygulamayı çalıştırdığımda doğru bir şekilde çalışıyor. Ben bunu arayüz olarak da XAML dosyasında kontrol etmek istiyorum. Yani sorunsuz bir şekilde çalışmasını istiyorum. Bu sorunu nasıl çözebilirim? Nerede hata yapıyorum yardımcı olabilir misiniz?
		
		
	
	
		
 
	
		
 
	
Kodlarım:
[CODE lang="csharp" title="Preferences.cs"] #region TitleBarHeight
private GridLength _titleBarHeight = new GridLength(48, GridUnitType.Pixel);
public GridLength TitleBarHeight
{
get { return _titleBarHeight; }
set
{
_titleBarHeight = value;
OnPropertyChanged("TitleBarHeight");
}
}
#endregion
#endregion
#region INotifyPropertyChanged Implementing
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion[/CODE]
[CODE lang="csharp" title="MainPageViewModel.cs"] public class MainPageViewModel
{
private Preferences _preferences = new Preferences();
public Preferences Preferences
{
get { return _preferences; }
set
{
_preferences = value;
}
}
}
[/CODE]
[CODE lang="csharp" title="MainPage.xaml.cs"] public MainPage()
{
InitializeComponent();
ViewModel = new MainPageViewModel();
}
public MainPageViewModel ViewModel { get; set; }[/CODE]
[CODE lang="xml" title="MainPage.xaml"] <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{x:Bind ViewModel.Preferences.TitleBarHeight}"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Background="Aqua"/>
</Grid>[/CODE]
Sorun,
	
	
	
	
	
		
ile çözülmüştür. Konu kilitlenebilir.
	
		
			
		
		
	
				
			Kodlarım:
[CODE lang="csharp" title="Preferences.cs"] #region TitleBarHeight
private GridLength _titleBarHeight = new GridLength(48, GridUnitType.Pixel);
public GridLength TitleBarHeight
{
get { return _titleBarHeight; }
set
{
_titleBarHeight = value;
OnPropertyChanged("TitleBarHeight");
}
}
#endregion
#endregion
#region INotifyPropertyChanged Implementing
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion[/CODE]
[CODE lang="csharp" title="MainPageViewModel.cs"] public class MainPageViewModel
{
private Preferences _preferences = new Preferences();
public Preferences Preferences
{
get { return _preferences; }
set
{
_preferences = value;
}
}
}
[/CODE]
[CODE lang="csharp" title="MainPage.xaml.cs"] public MainPage()
{
InitializeComponent();
ViewModel = new MainPageViewModel();
}
public MainPageViewModel ViewModel { get; set; }[/CODE]
[CODE lang="xml" title="MainPage.xaml"] <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{x:Bind ViewModel.Preferences.TitleBarHeight}"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Background="Aqua"/>
</Grid>[/CODE]
Sorun,
		XML:
	
	Height="{Binding Preferences.TitleBarHeight, Source={StaticResource MainPageViewModel}}"
			
				Son düzenleyen: Moderatör: 
			
		
	
								
								
									
	
		
			
		
		
	
	
	
	
		
			
		
		
	
								
							
							 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		