【问题标题】:Getting resource not found. error in wpf user control未找到获取资源。 wpf用户控件中的错误
【发布时间】:2014-03-27 14:19:38
【问题描述】:
<Window x:Class="Hotel_WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="" Height="644" Width="1369" Icon="/Hotel_WPF;component/Resources/DCE.ico" 
        ResizeMode="CanResize" ShowInTaskbar="False" Topmost="False" 
        WindowStartupLocation="CenterScreen" WindowStyle="ThreeDBorderWindow" 
        BorderBrush="Black" FontFamily="Calibri" AllowsTransparency="False" 
        BorderThickness="1" WindowState="Maximized" 
        xmlns:my="clr-namespace:DC.CommandButton;assembly=DC.CommandButton">
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFEFEDE6" Offset="0.006" />
            <GradientStop Color="#FF174EB8" Offset="1" />
            <GradientStop Color="#FFC7D7FC" Offset="0.503" />
        </LinearGradientBrush>
    </Window.Background>
    <Grid Focusable="False" ShowGridLines="True" Background="{x:Null}">
        <Grid.OpacityMask>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black" Offset="0" />
                <GradientStop Color="White" Offset="1" />
            </LinearGradientBrush>
        </Grid.OpacityMask>
        <my:DcButton Height="40" HorizontalAlignment="Left" Margin="196,361,0,0" Name="dcButton1" VerticalAlignment="Top" Width="153" />
    </Grid>
</Window>

我已经为按钮编写了 MouseEnter、MouseLeave 事件。它在测试项目中运行良好,但在其他解决方案中运行良好。请帮忙。

【问题讨论】:

    标签: wpf user-controls


    【解决方案1】:

    再检查一遍

    xmlns:my="clr-namespace:DC.CommandButton;assembly=DC.CommandButton"
    

    不应该是这样吗:(假设你的命名空间是 DC)

    xmlns:my="clr-namespace:DC;assembly=DC.CommandButton"
    

    【讨论】:

      猜你喜欢
      • 2015-09-22
      • 1970-01-01
      • 2022-07-21
      • 2020-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-31
      • 1970-01-01
      相关资源
      最近更新 更多