在 Silverlight 3 中使用 Blend 控制继承

发布于 2024-08-27 23:50:31 字数 183 浏览 5 评论 0原文

我想为我的一些用户控件创建一个自定义基类。 在 VS2008 中执行此操作很好,并且按预期进行编译,但是当我在 Blend 3 中编辑控件时,blabla.g.vb 中的基类始终更改回 System.Windows.Controls.UserControl。

我如何强制 Blend 保留指定的基类?

问候 克里斯托夫

i would like to create a custom base class for some of my UserControls.
Doing this in VS2008 is fine and compiles as expected, but when i edit the control in Blend 3 the base class in the blabla.g.vb is always changed back to System.Windows.Controls.UserControl.

How can i force Blend to keep the assigned base class?

regards
Christoph

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

任性一次 2024-09-03 23:50:32

你能展示一下你的XAML吗?

我怀疑情况是您的 XAML 是这样的:

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:SilverlightApplication15"
             x:Class="SilverlightApplication15.MainPage"
             Width="640"
             Height="480">

    <Grid x:Name="LayoutRoot"
          Background="#FF313131" />
</UserControl>

当它应该是这样的:

<local:BlahBlah xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:SilverlightApplication15"
                x:Class="SilverlightApplication15.MainPage"
                Width="640"
                Height="480">

    <Grid x:Name="LayoutRoot"
          Background="#FF313131" />
</local:BlahBlah>

.g.vb 文件是从 XAML 生成的,因此它不是您应该直接编辑的文件。

Can you show your XAML?

I suspect the case is your XAML is like this:

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:SilverlightApplication15"
             x:Class="SilverlightApplication15.MainPage"
             Width="640"
             Height="480">

    <Grid x:Name="LayoutRoot"
          Background="#FF313131" />
</UserControl>

When it should be something like:

<local:BlahBlah xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:SilverlightApplication15"
                x:Class="SilverlightApplication15.MainPage"
                Width="640"
                Height="480">

    <Grid x:Name="LayoutRoot"
          Background="#FF313131" />
</local:BlahBlah>

The .g.vb file is generated from the XAML so it's not a file you should edit directly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文