Skip to content

Instantly share code, notes, and snippets.

#if !AMAZON
var adView = new AdView(this);
(...)
#endif
<Reference Include="Xamarin.GooglePlayServices.Ads, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" Condition="'$(Configuration)' != 'ReleaseAmazon' And '$(Configuration)' != 'DebugAmazon'">
<HintPath>..\..\packages\Xamarin.GooglePlayServices.Ads.42.1021.1\lib\MonoAndroid70\Xamarin.GooglePlayServices.Ads.dll</HintPath>
</Reference>
<Import Project="..\..\packages\Xamarin.GooglePlayServices.Ads.42.1021.1\build\MonoAndroid70\Xamarin.GooglePlayServices.Ads.targets" Condition="Exists('..\..\packages\Xamarin.GooglePlayServices.Ads.42.1021.1\build\MonoAndroid70\Xamarin.GooglePlayServices.Ads.targets') And '$(Configuration)' != 'ReleaseAmazon' And '$(Configuration)' != 'DebugAmazon'" />
public App()
{
// ...
var page = FreshPageModelResolver.ResolvePageModel<DashboardViewModel>();
var basicNavContainer = new FreshNavigationContainer(page);
MainPage = basicNavContainer;
}
public Command AddMonthCmd => new Command(async () =>
{
await CoreMethods.PushPageModel<MonthEditViewModel>();
// lub await CoreMethods.PushPageModel<MonthEditViewModel>(SelectedMonth);
});
public override void Init(object initData)
{
base.Init(initData);
if (initData is MonthItem monthItem)
{
// Przekazaliśmy obiekt w parametrze PushPageModel w DashboardViewModel
}
else
{
// Tutaj wywołaliśmy PushPageModel w DashboardViewModel bez parametru
public Command SaveCmd => new Command(async () =>
{
await CoreMethods.PopPageModel();
// lub await CoreMethods.PopPageModel(data);
});
public override void ReverseInit(object returnedData)
{
base.ReverseInit(returnedData);
// Tutaj możemy odczytać dane
}
public Command SaveCmd => new Command(async () =>
{
if (/* Ten miesiąc już istnieje? */)
{
await CoreMethods.DisplayAlert("", AppResources.MothAlreadyExistsMessage, AppResources.Ok); // Powiedzmy użytkownikowi, że ten miesiąc dodał już wczesniej
}
else
{
// Zapisz miesiąc
}
public App()
{
InitializeComponent();
var fs = DependencyService.Get<IFileService>();
FreshIOC.Container.Register(fs);
FreshIOC.Container.Register<IDbService, DbService>();
// ...
}
public DbService(IFileService fileService)
{
_fileService = fileService;
_connection = new SQLiteConnection(_fileService.DbPath);
_connection.CreateTable<MonthItem>();
_connection.CreateTable<BudgetItem>();
}