forked from dotnet-bluetooth-le/dotnet-bluetooth-le
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
using AppKit; | ||
using Foundation; | ||
using MvvmCross.Core; | ||
using MvvmCross.Forms.Platforms.Mac.Core; | ||
using Xamarin.Forms; | ||
using Xamarin.Forms.Platform.MacOS; | ||
|
||
namespace BLE.Client.macOS | ||
{ | ||
[Register("AppDelegate")] | ||
public class AppDelegate : NSApplicationDelegate | ||
public class AppDelegate : MvxFormsApplicationDelegate | ||
{ | ||
public override NSWindow MainWindow { get; } | ||
|
||
public AppDelegate() | ||
{ | ||
} | ||
var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled; | ||
|
||
public override void DidFinishLaunching(NSNotification notification) | ||
{ | ||
// Insert code here to initialize your application | ||
var rect = new CoreGraphics.CGRect(200, 1000, 500, 768); | ||
MainWindow = new NSWindow(rect, style, NSBackingStore.Buffered, false) | ||
{ | ||
Title = "Xamarin.Forms Badge Plugin on Mac!", | ||
TitleVisibility = NSWindowTitleVisibility.Hidden | ||
}; | ||
} | ||
|
||
public override void WillTerminate(NSNotification notification) | ||
protected override void RegisterSetup() | ||
{ | ||
// Insert code here to tear down your application | ||
this.RegisterSetupType<Setup>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Acr.UserDialogs; | ||
using MvvmCross; | ||
using MvvmCross.Forms.Platforms.Mac.Core; | ||
using MvvmCross.ViewModels; | ||
using Plugin.Permissions; | ||
using Plugin.Settings; | ||
|
||
namespace BLE.Client.macOS | ||
{ | ||
public class Setup : MvxFormsMacSetup | ||
{ | ||
protected override IMvxApplication CreateApp() | ||
{ | ||
return new BleMvxApplication(); | ||
} | ||
|
||
protected override void InitializeIoC() | ||
{ | ||
base.InitializeIoC(); | ||
|
||
Mvx.IoCProvider.RegisterSingleton(() => UserDialogs.Instance); | ||
Mvx.IoCProvider.RegisterSingleton(() => CrossSettings.Current); | ||
Mvx.IoCProvider.RegisterSingleton(() => CrossPermissions.Current); | ||
} | ||
|
||
protected override Xamarin.Forms.Application CreateFormsApplication() | ||
{ | ||
return new BleMvxFormsApp(); | ||
} | ||
|
||
/* | ||
public override IEnumerable<Assembly> GetPluginAssemblies() | ||
{ | ||
return new List<Assembly>(base.GetViewAssemblies().Union(new[] { typeof(MvvmCross.Plugins.BLE.iOS.Plugin).GetTypeInfo().Assembly })); | ||
} | ||
*/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters