예제 #1
0
        private static void FluentStyle()
        {
            var iconFile = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
                ? "wwwroot/photino-logo.ico"
                : "wwwroot/photino-logo.png";

            mainWindow = new PhotinoWindow()
                         .SetIconFile(iconFile)
                         .SetTitle($"My Photino Window {_windowNumber++}")

                         //.Load(new Uri("https://google.com"))
                         .Load("wwwroot/main.html")
                         //.LoadRawString("<h1>Hello Photino!</h1>")

                         //.SetChromeless(true)
                         //.SetFullScreen(true)
                         //.SetMaximized(true)
                         //.SetMinimized(true)
                         //.SetResizable(false)
                         //.SetTopMost(true)
                         //.SetUseOsDefaultLocation(false)
                         //.SetUseOsDefaultSize(false)
                         //.SetZoom(150)

                         //.SetContextMenuEnabled(false)
                         //.SetDevToolsEnabled(false)
                         //.SetGrantBrowserPermissions(false)

                         //.Center()
                         //.SetSize(800, 600)
                         //.SetHeight(600)
                         //.SetWidth(800)
                         //.SetLocation(new Point(50, 50))
                         //.SetTop(50)
                         //.SetLeft(50)
                         //.MoveTo(new Point(10, 10))
                         //.MoveTo(20, 20)
                         //.Offset(new Point(150, 150))
                         //.Offset(250, 250)

                         .RegisterCustomSchemeHandler("app", AppCustomSchemeUsed)

                         .RegisterWindowCreatingHandler(WindowCreating)
                         .RegisterWindowCreatedHandler(WindowCreated)
                         .RegisterLocationChangedHandler(WindowLocationChanged)
                         .RegisterSizeChangedHandler(WindowSizeChanged)
                         .RegisterWebMessageReceivedHandler(MessageReceivedFromWindow)
                         .RegisterWindowClosingHandler(WindowIsClosing)

                         //.SetTemporaryFilesPath(@"C:\Temp")

                         .SetLogVerbosity(_logEvents ? 2 : 0);


            mainWindow.WaitForClose();

            mainWindow.Center(); //will never happen - this is blocking.
        }