Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must have a Storyboard object reference before this trigger action can execute in TimePicker #4065

Closed
shahshyam opened this issue Mar 3, 2021 · 15 comments · Fixed by #4088
Closed
Labels
Milestone

Comments

@shahshyam
Copy link

My XAML code

<mah:TimePicker Grid.Row="2" Grid.Column="0" Margin="0,0,0,10" >
</mah:TimePicker>

Getting following error in TimePicker.

Error detail :
System.Windows.Markup.XamlParseException
HResult=0x80131501
Message=Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.

Inner Exception 1:
InvalidOperationException: Must have a Storyboard object reference before this trigger action can execute.

Visual Studio 2017 Enterprise /VS 2019 community
Net 4.6.

@shahshyam shahshyam added the Bug label Mar 3, 2021
@timunie
Copy link
Collaborator

timunie commented Mar 3, 2021

Hi @shahshyam

Please fill in the entire issue template and provide a sample App. I cannot reproduce your issue with the latest version of MahApps.

Happy coding
Tim

@punker76
Copy link
Member

punker76 commented Mar 4, 2021

@shahshyam Which version of MahApps are you using?

@shahshyam
Copy link
Author

shahshyam commented Mar 4, 2021

Sorry for delay response. I am using latest version of Mahapp. My project structure is It is vsto addins which load sidebar . The sidebar was WinForms user control and its load WPF usercontrol on it. WPF user control is using MahAppControl called TimePicker. It is working as normal WPF Application. Other controls are loading on window form hosted WPF control but TimePicker give exception

@punker76
Copy link
Member

punker76 commented Mar 4, 2021

@shahshyam So you have the WPF inside a WinForms control? Can you check if you add all necessary resources at your WPF control? Or is there also a App.xaml?

@shahshyam
Copy link
Author

shahshyam commented Mar 4, 2021

yes, I have wpf control in side WinForms control and there is not any App.xml and other control is working as expected like tabcontrol , calendarpicker etc. I have includes all there font, control and theme files under UserControl.Resource tag

@punker76
Copy link
Member

punker76 commented Mar 4, 2021

@shahshyam Ok, thx for the clarification.

@pacoweb
Copy link

pacoweb commented Mar 12, 2021

I have the same problem. I´m using the latest version too and in my case the WPF is not inside WinForms control.
In my case it works on a UserControl but not in MainWindow.

@TSerious
Copy link

I have the same problem and it also doesn't work in a UserControl.

TSerious added a commit to TSerious/MahApps.Metro that referenced this issue Mar 26, 2021
Replace DynamicResource with StaticResource in Storyboard Triggers
@derekdd23
Copy link

Is there a work around for this issue while this remains open?

@timunie
Copy link
Collaborator

timunie commented Apr 8, 2021

Hi @derekdd23

I still cannot reproduce this issue. May it be possible to provide a not working sample App?

To answer your question: at least you can grab the original Style and replace DynamicResource with StaticResource in the ControlTemplate.Triggers:

See: d6c712f

Happy coding
Tim

@punker76 punker76 added this to the 2.4.5 milestone Apr 20, 2021
punker76 added a commit that referenced this issue Apr 20, 2021
… get Storyboards inside Triggers

Changes made by Tobias Ernst @TSerious
punker76 added a commit that referenced this issue Apr 20, 2021
punker76 added a commit that referenced this issue Apr 20, 2021
@pacoweb
Copy link

pacoweb commented Apr 20, 2021

Hi,
I have reproduced the error.
I think it is related to how the application starts.
I use DI and the application starts like this (more or less):

    public static class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            var app = new App();

            var mainWindow = new MainWindow();

            app.InitializeComponent();

            app.Run(mainWindow);
        }
    }

I am attaching a compressed file with the project that reproduces this problem when the application starts.
WpfMahAppDatePickerError.zip

Thanks!!

@punker76
Copy link
Member

@pacoweb It works now with the latest changes.

image

@pacoweb
Copy link

pacoweb commented Apr 20, 2021

Thanks!

When is the nuget package update scheduled?

@punker76
Copy link
Member

@pacoweb v2.4.5 is out now

@pacoweb
Copy link

pacoweb commented Apr 21, 2021

Thank you!

Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

6 participants