LoginSignup
0
0

More than 3 years have passed since last update.

Mobile Blazor Bindings を使用したMac版アプリケーションで最小化ボタンを有効にする方法

Last updated at Posted at 2020-12-22

概要

Mobile Blazor Bindings を使用して Mac用アプリケーションを作っているときに、最小化ボタン(左上にある黄色のボタン)を有効化する方法

結論

AppDelegate.cs の style を設定している箇所に NSWindowStyle.Miniaturizable を追加する。

詳細

AppDelegate.csに書かれているAppDelegateクラスのコンストラクタにstyleの設定が定義されているので、style設定にNSWindowStyle.Miniaturizable を追加する。

変更前
public AppDelegate()
{
    var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
    var rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
    MainWindow = new NSWindow(rect, style, NSBackingStore.Buffered, false)
    // 以下省略
}
変更後
public AppDelegate()
{
    var style = NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
    var rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
    MainWindow = new NSWindow(rect, style, NSBackingStore.Buffered, false)
    // 以下省略

これだけでOK

終わり

多分将来の自分がまた同じように迷うと予想しているので備忘録として記事にしておく。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0