跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Windows] 请问在 winui3 中如何实现鼠标悬停按钮修改按钮样式的功能?

发表于

最近在学 winui3 ,遇到了这个问题。如果是 WPF 的话有 trigger ,这个很容易解决。但是 winui3 里面把 trigger 砍了,我查阅了一下,似乎需要使用 VisualStateManager 来实现。

但是这个 VisualStateManager 需要放到控件的 Template 中使用,这样的话就没办法使用原来的样式,得自定义模板了。如果我想保持原来的按钮样式,只是在鼠标悬停的时候改一下背景色或者给按钮字体加个下划线,应该如何实现?

PS. 最后吐槽一下 winui3 的开发体验,其实做的挺好,设计理念也不错,XML 描述界面和代码实现分离也是我当初学习编程时候的主流观点。但是毕竟放到现在过时了,不说 XML 的捉急表达能力,界面文件一写一大坨,单说这个残废的热重载就让人抓狂,这方面体验最好的感觉还是 flutter ,那个热重载简直是丝滑。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.