wasteam / waslibs

Windows App Studio WinRT XAML & UWP Libraries
MIT License
313 stars 133 forks source link

Customising ImageEx #24

Closed darshanrampatel closed 6 years ago

darshanrampatel commented 8 years ago

Hi,

I want to customise the ImageEx control - I have copied the 6 files within the ImageEx directory into my Project and amended the namespace to MyProject.Controls.

However, when I try and use my control, I get the following exception:

System.NullReferenceException: Object reference not set to an instance of an object.
   at MyProject.Controls.ImageEx.MeasureOverride(Size availableSize)

Looking into this, it seems as though _progress is still null at this time, so the line _progress.Width = _progress.Height = Math.Min(1024, Math.Min(availableSize.Width, availableSize.Height)) / 8.0; fails

How can I resolve this?

javitosanchez commented 8 years ago

It seems there is something wrong when you copied the files into your solution. I should review that all the files needed are included in your project with the same file properties in visual studio.

JohnnyWestlake commented 8 years ago

Most likely you didn't merged the default ImageEx XAML theme into Themes/Generic.xaml in your project.

darshanrampatel commented 6 years ago

Closing this as no longer relevant (using the Windows Community Toolkit now).