我正在尝试创建与 MS SymbolIcon 相同的自定义符号图标控件,它将获取枚举符号值作为输入,并且将从字典<Symbol, string> 集合中检索等效路径数据值。但是从 IconElement 继承的符号图标类以及我的应用程序中面临的以下相同问题。
“IconElement 不采用带有 0 个参数的构造函数”
但我已将我的构造函数标记为 extern 并用分号括起来以解决构造函数问题。
public class CustomSymbolIcon : IconElement
{
public extern CustomSymbolIcon();
}
Run Code Online (Sandbox Code Playgroud)
But my question is, I can get input from the end user as Symbol Enum and retrieved equivalent path geometry based on input from the stored dictionary. But I couldn't bind the path geometry to the path element(Targeted Custom icon class)and I can't write the template style for this class. …
我需要在 WinUI 3 桌面应用程序中实现以下要求。
我已经在 WinUI UWP 应用程序中这样做了。
对于屏幕边界,
var visibleBounds = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().VisibleBounds;
var scaleFactor = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
Size screenSize = new Size((visibleBounds.Width * scaleFactor), (visibleBounds.Height * scaleFactor));
Run Code Online (Sandbox Code Playgroud)
对于光标:
Window.Current.CoreWindow.PointerCursor = new CoreCursor(CoreCursorType.SizeNorthwestSoutheast, 0);
Run Code Online (Sandbox Code Playgroud)
有人请建议如何在 WinUI 桌面应用程序中实现相同的要求?