the49ltd / The49.Maui.BottomSheet

.NET MAUI library used to display pages as Bottom Sheets
MIT License
331 stars 35 forks source link

binding isnt work from viewmodel to bottomsheet #111

Open mohammedmsadiq opened 7 months ago

mohammedmsadiq commented 7 months ago

hi cant seem to bind data from bottomsheet to my view model see below for example

`<the49:BottomSheet xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:the49="https://schemas.the49.com/dotnet/2023/maui" HasHandle="True" Padding="16,32" x:Class="app.Controls.SettingsLanguagesBottomSheetControl">

` view model ` private async void ChooseLanguageTask() { SelectedLanguageText = itemDetail.LanguageTitle; var bottomSheet = new SettingsLanguagesBottomSheetControl(); await bottomSheet.ShowAsync(Application.Current.Windows[0]); }` binding works fine from contentpage but not to bottomsheet
radoczsanyi commented 14 hours ago

how would this ever work?

You need to define bottomSheet.BindingContext = new YourViewModel() to make the bindings work.