无法在混合中使用c#操纵故事板

时间:2010-06-16 14:24:37

标签: c# expression-blend

这是问题所在, 在Blend 3中我有12个故事板,我可以使用xaml操纵它们,但当我尝试用c#操纵它们时,混合似乎看不到它们。哪个可能是问题?

确切的错误是: 名称'存在的stroyboard的名称'在当前上下文中不存在

2 个答案:

答案 0 :(得分:1)

您确定您的名称设置正确吗?

在您的MainWindow.xaml文件中,您有以下内容:

<Window.Resources>
    <Storyboard x:Key="login_fadein">
                ...
    </Storyboard >
</Windows.Resources>

答案 1 :(得分:0)

public partial class MainWindow : Window
{
        Storyboard loginin;
        Storyboard dersout;
        Storyboard sinifout;
        Storyboard konuout;
        Storyboard menus1out;
        Storyboard kmenuout;
        Storyboard soruout;
        Storyboard loginout;
        Storyboard dersin;
        Storyboard menu1in;

        Storyboard sinifsecin;
        Storyboard kmenuin;

    public MainWindow()
    {
        this.InitializeComponent();
        loginin = (Storyboard)Window.Resources["login_fadein"];
        dersout = (Storyboard)Window.Resources["derssec_fadeout"];
        sinifout = (Storyboard)Window.Resources["sinifsec_fadeout"];
        konuout = (Storyboard)Window.Resources["konu_fadeout"];
        menus1out = (Storyboard)Window.Resources["menus1_fadeout"];
        kmenuout = (Storyboard)Window.Resources["menukonu_fadeout"];
        soruout = (Storyboard)Window.Resources["soru_fadeout"];
        loginout = (Storyboard)Window.Resources["login_fadeout"];
        dersin = (Storyboard)Window.Resources["derssec_fadein"];
        menu1in = (Storyboard)Window.Resources["menus1_fadein"];
        dersout = (Storyboard)Window.Resources["derssec_fadeout"];
        sinifsecin = (Storyboard)Window.Resources["sinifsec_fadein"];
        kmenuin = (Storyboard)Window.Resources["menukonu_fadein"];
        kmenuout = (Storyboard)Window.Resources["menukonu_fadeout"];
    }

当然首先我应该定义我在说什么:D