angelsix / fasetto-word

The new chat application for Fasetto, completely open-source :)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Design Time Exception

BEDIRHANSAMSA opened this issue · comments

Hello,

I am getting this error:

at System.Windows.Controls.Page.System.Windows.IWindowService.get_Width()
at System.Windows.Controls.Page.get_WindowWidth()
at UI.Animation.PageAnimations.SlideAndFadeInFromRight(Page page, Single seconds) in UI\Animation\PageAnimations.cs:line28
at UI.Pages.BasePage1.AnimateIn() in \UI\Pages\BasePage.cs:line 115 at UI.Pages.BasePage1.BasePage_Loaded(Object sender, RoutedEventArgs e) in \UI\Pages\BasePage.cs:line 97
at System.Threading.Tasks.Task.<>c.b__139_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

image

Because of this method:
image
If I change like this page.WindowWidth to 700:
image

It's working, how can I fix this?

image

You may want to disable project code when working with this page. The page is attempting to gather the window width while in design time mode and fails. On the XAML designer you can enable and disable project code easily.

image

As an aside: I would recommend using event triggers and storyboards instead of animating in the code-behind. It will make your life easier when using the designer. His method for animating was good, but I found it overly complicated and hard to debug. Cases like this popped up all of the time. You can easily make a custom animation control that can be used across other projects.

Hello,

I am getting this error:

at System.Windows.Controls.Page.System.Windows.IWindowService.get_Width() at System.Windows.Controls.Page.get_WindowWidth() at UI.Animation.PageAnimations.SlideAndFadeInFromRight(Page page, Single seconds) in UI\Animation\PageAnimations.cs:line28 at UI.Pages.BasePage1.AnimateIn() in \UI\Pages\BasePage.cs:line 115 at UI.Pages.BasePage1.BasePage_Loaded(Object sender, RoutedEventArgs e) in \UI\Pages\BasePage.cs:line 97 at System.Threading.Tasks.Task.<>c.b__139_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

image

Because of this method: image If I change like this page.WindowWidth to 700: image

It's working, how can I fix this?

image

The only solution I've found is by adding d:Content="{Binding}" inside the frame itself not the page.