.Netfromwork4.7 升级 .Net5.0 后 Style 报错:无法找到 Microsoft.VisualStudio.Xsurface.Wpf

Esiang Chioa 1 Reputation point
2021-11-19T07:39:19.927+00:00
    <Style x:Key="{x:Type controls:NebulaWindow}" TargetType="{x:Type controls:NebulaWindow}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
        <Setter Property="Background" Value="{DynamicResource CommonBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource ControlBorder}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="IsShowTaskBar" Value="True" />
        <Setter Property="Opacity" Value="0.99" />
        <Setter Property="WindowChrome.WindowChrome" Value="{DynamicResource WindowChromeKey}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:NebulaWindow}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="CloseStoryboard" />
                        <Storyboard x:Key="OpenStoryboard" />
                    </ControlTemplate.Resources>
.........

NebulaWindow 是自定义窗口控件,继承system.window ..目前将项目.Netfromwork4.7 升级 .Net5.0。该style 属性ControlTemplate 报错:类型引用无法找到名为:Microsoft.VisualStudio.Xsurface.Wpf;该style在.Netfromwork4.7下正常使用。

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,177 questions
{count} votes