Почему не отображаются элементы страниц, а пишет communitytoolkit.mvvm.input.relaycommand?
Что нужно сделать чтобы исправить?
namespace MyWallet.ViewModel
{
internal class MainViewModel : ViewModedBase
{
private Page CashAccPage = new CashAcc();
private Page InfoChartsPage = new InfoCharts();
private Page MainMenuPage = new MainMenu();
private Page _CurPage = new MainMenu();
public Page CurPage
{
get => _CurPage;
set => Set(ref _CurPage, value);
}
public ICommand OpenMainPage
{
get
{
return new RelayCommand(()=> CurPage = MainMenuPage);
}
}
public ICommand OpenCashAccPage
{
get
{
return new RelayCommand(() => CurPage = CashAccPage);
}
}
public ICommand OpenInfoChartsPage
{
get
{
return new RelayCommand(() => CurPage = InfoChartsPage);
}
}
}
}
namespace MyWallet.ViewModel
{
internal abstract class ViewModedBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void onPropertyChanged([CallerMemberName] string PropertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(PropertyName));
}
protected virtual bool Set<T>(ref T field, T value, [CallerMemberName] string PropertyName = null)
{
if (Equals(field, value)) return false;
field = value;
onPropertyChanged(PropertyName);
return true;
}
}
}
И собственно сами кнопки которые должны переключать страницы
<StackPanel Orientation="Vertical" Background="Transparent">
<Button Content="Главная" Template="{StaticResource ResourceKey=LeftMenu}" Command="{Binding OpenMainPage}"/>
<Button Content="Счета" Template="{StaticResource ResourceKey=LeftMenu}" Command="{Binding OpenCashAccPage}"/>
<Button Content="Графики" Template="{StaticResource ResourceKey=LeftMenu}" Command="{Binding OpenInfoChartsPage}"/>
<Button Content="Валюта" Template="{StaticResource ResourceKey=LeftMenu}"/>
<Button Content="Регулярные платежи" Template="{StaticResource ResourceKey=LeftMenu}"/>
<Button Content="Настройки" Template="{StaticResource ResourceKey=LeftMenu}"/>
</StackPanel>