xaml 相关问题

可扩展应用程序标记语言(XAML)是一种基于XML的声明式语言,用于在各种框架中初始化结构化值和对象。当问题是关于具有特定框架的XAML的使用时,还应该提供框架的标签,例如, [wpf](Windows Presentation Foundation),[silverlight],[windows-phone],[windows-store-apps](Windows 8商店应用),[win-universal-app],[xamarin.forms]或[工作流程 - 基础]

将 Collection 类型的 AttachedProperty 绑定到 TemplatedParent

我想创建一个附加属性来保存 MenuItem 对象的集合。这些将在我的 GroupBox 自定义 ControlTemplate 中使用。在该 ControlTemplate 中,我想使用我的自定义

回答 1 投票 0

WPF:ItemsPanelTemplate 显示每个项目具有固定高度比例的元素

我想将 ItemsControl 与 ItemsSource 一起使用。我的问题是如何确保项目在显示时保持其高度比。这些项目可以有不同的尺寸,每次我调整尺寸

回答 1 投票 0

水平模式下 NavigationViewItems 的下划线太小

我正在 Widows 10 计算机的 WinUI 桌面应用程序中使用 NavigationView。从 NavigationView 中选择的下划线 i 应覆盖整个文本,但事实并非如此。这是一个设计错误,还是

回答 1 投票 0

关闭 RecognizesAccessKey 的 WPF DataGrid

我有一个非常基本的 WPF 应用程序,并附有 MS SQL 服务器作为数据源。我的数据网格声明如下: 我有一个非常基本的 WPF 应用程序,并附有 MS SQL 服务器作为数据源。我的数据网格声明如下: <DataGrid HorizontalAlignment="Left" Margin="10,88,0,0" VerticalAlignment="Top" Height="456" Width="1018" ItemsSource="{Binding}" /> 当我运行应用程序时,我看到数据从数据库加载到网格中,但列标题看起来很奇怪。每个最初包含下划线的标题都删除了该下划线:some_title 变为 sometitle。 我发现这是因为下划线被识别为控制符号,将下一个符号变成助记符。 如何禁用此行为? 我发现如果你将单下划线加倍,即 some__title 而不是 some_title,则可以绕过此行为。但由于我的数据源是外部数据库,我无法影响它。或者也许用转换器? 我认为最好的方法是将属性RecognizesAccessKey转为false,但不幸的是它无法访问。 我是 WPF 新手,感谢您的帮助! 附注她是史努比的照片(如果有帮助的话) 编辑:我的目标框架是.net 4.5 尽管这是一个老问题,但我找到了解决方案。它可能对某人有帮助。 <DataGrid HorizontalAlignment="Left" Margin="10,88,0,0" VerticalAlignment="Top" Height="456" Width="1018" ItemsSource="{Binding}" > <DataGrid.ColumnHeaderStyle> <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="DataGridColumnHeader"> <Border> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="False" /> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </DataGrid.ColumnHeaderStyle> </DataGrid> 我能想到的最佳解决方案是拦截 DataGrid 事件 AutoGeneratingColumn 并将所有下划线替换为两个下划线,如下所示: private void DataGrid_AutoGeneratingColumn_1(object sender, DataGridAutoGeneratingColumnEventArgs e) { string header = e.Column.Header.ToString(); // Replace all underscores with two underscores, to prevent AccessKey handling e.Column.Header = header.Replace("_", "__"); } 根据我的理解,(遗憾的是)不可能在不重新定义整个控制模板的情况下覆盖底层 RecognizesAccessKey 的 ContentPresenter 的值。 请参阅 msdn 论坛上的此主题:如何在标签上设置 RecognizesAccessKey 而不影响其他参数?. 您可以使用自定义列,当您使用自定义列时,您可以根据需要定义列标题。 要添加到已接受的答案中,如果您想保留数据网格的原始样式,请按如下所示操作,并将 ContentPresenter 的 RecognizeAccessKey 更改为 False。 <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type DataGridColumnHeader}"> <Grid> <Themes:DataGridHeaderBorder BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" IsClickable="{TemplateBinding CanUserSort}" IsPressed="{TemplateBinding IsPressed}" IsHovered="{TemplateBinding IsMouseOver}" Padding="{TemplateBinding Padding}" SortDirection="{TemplateBinding SortDirection}" SeparatorBrush="{TemplateBinding SeparatorBrush}" SeparatorVisibility="{TemplateBinding SeparatorVisibility}"> <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="False" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Themes:DataGridHeaderBorder> <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left"> <Thumb.Style> <Style TargetType="{x:Type Thumb}"> <Setter Property="Width" Value="8"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="Cursor" Value="SizeWE"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Thumb}"> <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </Thumb.Style> </Thumb> <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right"> <Thumb.Style> <Style TargetType="{x:Type Thumb}"> <Setter Property="Width" Value="8"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="Cursor" Value="SizeWE"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Thumb}"> <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </Thumb.Style> </Thumb> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> 通过 XAML,您可以更改 DataGridColumnHeader 行为以禁用将“_”解释为特殊字符(以便保留它): <DataGrid.Resources> <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate > <TextBlock Text="{Binding}" /> </DataTemplate> </Setter.Value> </Setter> </Style> </DataGrid.Resources>

回答 5 投票 0

如何向 Maui xaml 实体元素添加装饰后缀?

我想将装饰后缀添加到我的毛伊岛条目,如“测试”所示,这怎么可能?

回答 1 投票 0

WinUI 3:如何在更改选择时折叠导航菜单项

使用WinUI 3 当选择更改为另一个菜单项时,有什么方法可以折叠导航菜单项吗? 我尝试在“选择更改”事件中迭代菜单的所有选项,...

回答 1 投票 0

Winui3:如何在更改选择时折叠导航菜单项

使用WinUI3 当选择更改为另一个菜单项时,有什么方法可以折叠导航菜单项吗? 我尝试在“选择更改”事件中迭代菜单的所有选项,...

回答 1 投票 0

如何让DataGrid列背景透明?

我希望在 WPF 应用程序中的 DataGrid 中有一个具有透明背景的列。标题和单元格本身需要透明,但其中的内容不透明,这将是......

回答 1 投票 0

在 XAML 中将参数传递给资源控件

我将一个按钮定义为 ControlTemplate 中的资源,以便能够多次使用它。 ...

回答 1 投票 0

如何在XAML中无限播放GIF?

我的问题是,在我的代码中,GIF 播放一次然后就卡住了。我已经尝试了各种方法来解决这个问题,但不幸的是没有任何帮助。 我尝试停止它,然后将其设置为 positio...

回答 1 投票 0

AvaloniaUI:无法在 UserControl 中嵌入 VideoView 控件 (LibVlcSharp)

我是 AvaloniaUI 0.10.5 的新手。目前我正在 macOS 上的应用程序中使用 VideoView 控件 (LibVLCSharp.Avalonia 3.5.0)。该代码是 Donadren 示例 2 的副本: (https://github.com/dona...

回答 2 投票 0

为什么我在“边框”中看不到图像?

我正在 XAML 文件中制作图例,并使用边框来显示它的外观。我有三个这样的对象: 我正在 XAML 文件中制作图例,并使用 Border 来显示它的外观。我有三个这样的对象: <Border x:Name="box_Interior_PalletGroup_Color" Height="20" Width="20" Grid.Row="1" Grid.Column="0"> <Border.BorderBrush> <ImageBrush ImageSource="/Product.Customer.Client;component/Views/views/All_Colours.png" /> </Border.BorderBrush> </Border> <Border x:Name="box_Interior_Brown" Height="20" Width="20" Grid.Row="2" Grid.Column="0" Background="Brown"/> <Border x:Name="box_Interior_Transparant" Height="20" Width="20" Grid.Row="3" Grid.Column="0"> <Border.BorderBrush> <ImageBrush ImageSource="/Product.Customer.Client;component/Views/views/Transparant.png" /> </Border.BorderBrush> </Border> 图像 All_Colours.png 和 Transparant.png 已使用资源编辑器导入。 有关All_Colours.png的屏幕截图如下: 在“属性”窗口中,可以清楚地看到All_Colours.png属性中的BorderBrush,但在XAML中,什么也没有。 我应该怎么做才能在我的 XAML 设计中看到上述文件 All_Colours.png 和 Transparant.png? 顺便说一句,我的“Transparant.png”文件如下所示(白色和灰色方块的混合): 如果有人有更好的方法来显示一些“透明”,请随时告诉我。 提前致谢 我建议不要使用图像来实现透明度,而是使用路径。它只是更好地扩展: <Grid Height="200" Width="200"> <Grid.Background> <VisualBrush TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute"> <VisualBrush.Visual> <Canvas Background="White"> <Path Data="M0,0 L10,0 10,10 0,10Z M10,10 L20,10 20,20 10,20Z" Fill="gray"/> </Canvas> </VisualBrush.Visual> </VisualBrush> </Grid.Background> </Grid>

回答 1 投票 0

Viewbox填充所有列网格空间WPF

我正在创建一个程序来告诉用户他的帐户余额之类的东西。我在带有 ViewBox 的网格上显示此信息(因此可以将其大小调整为任何屏幕分辨率),问题是......

回答 1 投票 0

MAUI Java.Lang.IllegalStateException:'指定的子级已经有父级。您必须首先在子级的父级上调用removeView()。'

所以我有带有项目模板选择器的集合视图。这两个模板也有自己的集合视图和项目模板选择器。当我将第一个元素添加到内部集合视图时,一切......

回答 1 投票 0

如何在PowerShell中创建WinUI3 GUI?

目标 在基于 .NET 9 的 PowerShell 7.5 中创建并渲染一个简单的 WinUI3 GUI。没什么复杂的,只是一个窗口和一个按钮,例如这个 XAML 目标 在基于.NET 9的PowerShell 7.5中创建并渲染一个简单的WinUI3 GUI。没什么复杂的,只是一个窗口和一个按钮,比如这个XAML <?xml version="1.0" encoding="utf-8"?> <Window x:Class="App1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:App1" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <Button x:Name="myButton" Click="myButton_Click">Click Me</Button> </StackPanel> </Window> 在 PowerShell 中使用、导入或定义 C# 代码完全可以作为解决方案。 我唯一不想做的事情就是构建/编译我自己的二进制文件,例如可执行文件或 DLL。如果需要 CSharp 代码,我想使用在 PowerShell 中未编译的 .cs CSharp 文件。加载和使用 Microsoft 签名的 DLL 是完全没问题的。 到目前为止我已经尝试过的事情 我使用最新的 WindowsApps SDK 在 Visual Studio 2022 中创建了一个完全运行的 WinUI3 应用程序。然后在 Winui3 project\App1\bin\x64\Debug\net8.0-windows10.0.22621.0\win-x64 文件夹内,我尝试在 PowerShell 中加载所有 DLLs 。加载了大约 200 个 dll,但有一些加载失败。现在在 PowerShell 中我可以访问类型 [Microsoft.UI.Xaml.Window] 但当我尝试创建它的实例时New-Object -TypeName Microsoft.UI.Xaml.Window # Or [Microsoft.UI.Xaml.Window]::new() 我收到以下错误 MethodInvocationException: Exception calling ".ctor" with "0" argument(s): "The type initializer for '_IWindowFactory' threw an exception." 看起来 _IWindowFactory 缺少依赖项。 这是完整的错误消息 Exception : Type : System.Management.Automation.MethodInvocationException ErrorRecord : Exception : Type : System.Management.Automation.ParentContainsErrorRecordException Message : Exception calling ".ctor" with "0" argument(s): "The type initializer for '_IWindowFactory' threw an exception." HResult : -2146233087 CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException FullyQualifiedErrorId : TypeInitializationException InvocationInfo : ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 4 Line : [Microsoft.UI.Xaml.Window]::new() Statement : [Microsoft.UI.Xaml.Window]::new() PositionMessage : At line:1 char:1 + [Microsoft.UI.Xaml.Window]::new() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CommandOrigin : Internal ScriptStackTrace : at <ScriptBlock>, <No file>: line 1 TargetSite : Name : ConvertToMethodInvocationException DeclaringType : [System.Management.Automation.ExceptionHandlingOps] MemberType : Method Module : System.Management.Automation.dll Message : Exception calling ".ctor" with "0" argument(s): "The type initializer for '_IWindowFactory' threw an exception." Data : System.Collections.ListDictionaryInternal InnerException : Type : System.TypeInitializationException TypeName : _IWindowFactory TargetSite : Name : get_Instance DeclaringType : [Microsoft.UI.Xaml.Window+_IWindowFactory] MemberType : Method Module : Microsoft.WinUI.dll Message : The type initializer for '_IWindowFactory' threw an exception. InnerException : Type : System.TypeInitializationException TypeName : WinRT.ActivationFactory`1 TargetSite : Name : As DeclaringType : [WinRT.ActivationFactory`1[T]] MemberType : Method Module : Microsoft.WinUI.dll Message : The type initializer for 'WinRT.ActivationFactory`1' threw an exception. InnerException : Type : System.Runtime.InteropServices.COMException ErrorCode : -2147221164 TargetSite : Name : ThrowExceptionForHR DeclaringType : [System.Runtime.InteropServices.Marshal] MemberType : Method Module : System.Private.CoreLib.dll Message : Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)) Source : System.Private.CoreLib HResult : -2147221164 StackTrace : at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at WinRT.BaseActivationFactory..ctor(String typeNamespace, String typeFullName) at WinRT.ActivationFactory`1..ctor() at WinRT.ActivationFactory`1..cctor() Source : Microsoft.WinUI HResult : -2146233036 StackTrace : at WinRT.ActivationFactory`1.As(Guid iid) at Microsoft.UI.Xaml.Window._IWindowFactory..ctor() at Microsoft.UI.Xaml.Window._IWindowFactory..cctor() Source : Microsoft.WinUI HResult : -2146233036 StackTrace : at Microsoft.UI.Xaml.Window._IWindowFactory.get_Instance() at Microsoft.UI.Xaml.Window..ctor() at CallSite.Target(Closure, CallSite, Type) Source : System.Management.Automation HResult : -2146233087 StackTrace : at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo) at CallSite.Target(Closure, CallSite, Type) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) CategoryInfo : NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId : TypeInitializationException InvocationInfo : ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 4 Line : [Microsoft.UI.Xaml.Window]::new() Statement : [Microsoft.UI.Xaml.Window]::new() PositionMessage : At line:1 char:1 + [Microsoft.UI.Xaml.Window]::new() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CommandOrigin : Internal ScriptStackTrace : at <ScriptBlock>, <No file>: line 1 其他人也尝试过这个并得到了类似的结果。 另一个问题与此问题相关,请求 Microsoft 提供一些指导。 我不知道 Visual Studio 如何做到这一点,使这一切变得如此简单和自动化,但我相信我需要在 PowerShell 中手动执行相同的任务。 启动WinUI3应用程序非常复杂,支持XAML是另一个困难,因为它还需要编译的XAML文件(.xbf)、资源文件(.pri)等。这些可以使用SDK工具构建,但这里我将仅演示如何启动基于 PowerShell 7.4 且不带 XAML 的 WinUI .NET 8 应用程序,正如您将看到的那样,这并不那么容易: 首先创建一个目录并放入其中 以下.ps1文件,最新 Microsoft.WindowsAppSDK 包 nuget 的内容,仅 lib\net6.0-windows10.0.18362.0 目录(截至今天,它不针对 .NET 8),添加来自 Microsoft.Windows.CsWinRT nuget 的 WinRT.Runtime.dll 添加来自 Microsoft.Windows.SDK.NET.Ref nuget 的 Microsoft.Windows.SDK.NET.dll 从 WinAppSDK Runtime 添加Microsoft.WindowsAppRuntime.Bootstrap.dll(您可以在今天的 C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.5_5001.95.533.0_x64__8wekyb3d8bbwe 之类的地方找到)如果您想要为您的 Windows 提供漂亮的图标,可以选择放置一个 .ico 文件 这就是您的文件夹的外观(您可以删除它们用于 SDK 文档的 .xml 文件): 现在这是 BasicWinUI.ps1 的内容(如您所见,它是 95% C#) Add-Type -Path ".\WinRT.Runtime.dll" Add-Type -Path ".\Microsoft.Windows.SDK.NET.dll" Add-Type -Path ".\Microsoft.WindowsAppRuntime.Bootstrap.Net.dll" Add-Type -Path ".\Microsoft.InteractiveExperiences.Projection.dll" Add-Type -Path ".\Microsoft.WinUI.dll" $referencedAssemblies = @( "System.Threading" # for SynchronizationContext ".\WinRT.Runtime.dll" ".\Microsoft.Windows.SDK.NET.dll" ".\Microsoft.WindowsAppRuntime.Bootstrap.Net.dll" ".\Microsoft.InteractiveExperiences.Projection.dll" ".\Microsoft.WinUI.dll" ) #Note: we remove warning CS1701: Assuming assembly reference 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # used by 'Microsoft.WindowsAppRuntime.Bootstrap.Net' # matches identity 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Runtime', # you may need to supply runtime policy Add-Type -ReferencedAssemblies $referencedAssemblies -CompilerOptions /nowarn:CS1701 -Language CSharp @" using System; using System.Reflection; using System.Runtime.InteropServices; using System.Threading; using Microsoft.UI.Dispatching; using Microsoft.UI.Windowing; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.Windows.ApplicationModel.DynamicDependency; using Windows.Graphics; using Windows.UI.Popups; using WinRT.Interop; namespace BasicWinUI { public static class Program { [STAThread] public static void Main() { Bootstrap.Initialize(0x00010005); // asks for WinAppSDK version 1.5, or gets "Package dependency criteria could not be resolved" error XamlCheckProcessRequirements(); Application.Start((p) => { SynchronizationContext.SetSynchronizationContext(new DispatcherQueueSynchronizationContext(DispatcherQueue.GetForCurrentThread())); new App(); }); Bootstrap.Shutdown(); } [DllImport("microsoft.ui.xaml")] private static extern void XamlCheckProcessRequirements(); } public class App : Application { private MyWindow m_window; protected override void OnLaunched(LaunchActivatedEventArgs args) { if (m_window != null) return; m_window = new MyWindow(); m_window.Activate(); } } public class MyWindow : Window { public MyWindow() { Title = "Basic WinUI3"; // set icon by path AppWindow.SetIcon("BasicWinUI.ico"); // size & center var area = DisplayArea.GetFromWindowId(AppWindow.Id, DisplayAreaFallback.Nearest); var width = 300; var height = 150; var rc = new RectInt32((area.WorkArea.Width - width) / 2, (area.WorkArea.Height - height) / 2, width, height); AppWindow.MoveAndResize(rc); // give a "dialog" look if (AppWindow.Presenter is OverlappedPresenter p) { p.IsMinimizable = false; p.IsMaximizable = false; p.IsResizable = false; } // create the content as a panel var panel = new StackPanel { Margin = new Thickness(10) }; Content = panel; panel.Children.Add(new TextBlock { Text = "Are you sure you want to do this?", HorizontalAlignment = HorizontalAlignment.Center }); // create a panel for buttons var buttons = new StackPanel { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Center }; panel.Children.Add(buttons); // add yes & no buttons var yes = new Button { Content = "Yes", Margin = new Thickness(10) }; var no = new Button { Content = "No", Margin = new Thickness(10) }; buttons.Children.Add(yes); buttons.Children.Add(no); no.Click += (s, e) => Close(); yes.Click += async (s, e) => { // show some other form var dlg = new MessageDialog("You did click yes", Title); InitializeWithWindow.Initialize(dlg, WindowNative.GetWindowHandle(this)); await dlg.ShowAsync(); }; // focus on first button panel.Loaded += (s, e) => panel.Focus(FocusState.Keyboard); } } } "@; [BasicWinUI.Program]::Main() 我在 BasicWinUI 文件夹中使用这样的 .bat 启动它: C:\myPowerShellPath\PowerShell-7.4.2-win-x64\pwsh.exe -File BasicWinUI.ps1 这是你应该得到的:

回答 1 投票 0

使用 Key Enum Visual studio 时 F10 不起作用

我正在为我的学校项目制作键盘测试程序。除了 F10 键之外,一切都运行良好。每次我按下它,它都会给我发出错误噪音,我必须再次单击我的窗口......

回答 1 投票 0

Binding 和 x:Bind 的区别

UWP 中使用什么,Binding 或 x:Bind,它们之间有什么区别? 因为我看到很多帖子中人们使用 Binding,而我只在 UWP 中使用 x:Bind 进行 Bind。 仅在 MSDN 主页上

回答 3 投票 0

如何访问 C# 类的 Xaml 元素?

我有一个名为 B2_CONTENT.xaml 的用户控制文件,它有一个按钮。 它的源文件名为 G2_CONTENT.xaml.cs,该文件有一个按钮的单击事件 我还有另一个用户控件名称 B4_C...

回答 1 投票 0

Maui 使用类库中的 style.xaml

我在毛伊岛创建了 2 个项目。第一个是一个类库,其中包含资源字典。第二个是实际的应用程序,我想使用资源字典,所以我尝试在应用程序中引用它。

回答 1 投票 0

为什么我的 WPF 按钮在应用模板时不显示文本?

我正在尝试从一本旧书(Beginning Visual C# 2010)中学习 WPF。我尝试复制他们提供的示例(它看起来确实很可怕),但由于某种原因,文本不显示......

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.