开发者

Cannot manipulate storyboards with c# in blend

Here is the problem, in Blend 3 i have 12 storyboards, i can manipulate them with using xaml, but when i try to manipulate them with c#, blend seems cannot see them. Where could be th开发者_运维技巧e problem?

The exact error is : The name 'name of the stroyboard which exists' does not exists in the current context


Are you sure you have the names setup properly?

In your MainWindow.xaml file you have something like this:

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


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"];
    }

of course first i should define what i am talking about :D

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜