WPF - How to get rid of false design time errors -
In the design time, I have two false errors which are unable to estimate the value of items due to WPF. Actually it runs flawlessly at run time without actually running them. The question is how can I get rid of these errors?
Here's an example:
I have the following two in a class:
public static bool iSab (get; set;) public Fixed BULL ISEC (return)!}} The following converter works perfectly well:
public object convert (object value, type Goal type, object parameter, system globalization. Culture input culture) {If (HubbCostOfferPage.IsHubb & HubbCostOfferPage.CarObj.TestApprovedDate == blank) Visibility is visible; Return to visibility again; Collapsed;} The following however (although very similar) is not set for an "Object reference an instance of an object." Error, whose The meaning is that there is only one thing that I can see at design time without commenting outside of the StaticResource definition. It is a big mistake:
Change the public object (object value, type target type, object parameter , Si Tm. Globalization Ksnskriti information culture) {if (Hbbkostofr page. ISEC == true & amp; Amp; HubbCostOfferPage.CarObj.TestApprovedDate == blank) Return visibility. Visible; Again go back to visibility. Collapsed; } If I change HubbCostOfferPage.Isec with HubbCostOfferPage.IsHubb, then all work fine, so I know where the problem is.
If I change HubbCostOfferPage.IsEC! In HubbCostOfferPage.IsHubb converters, I get the same problem the designer seems to complain because it can not evaluate "!" During design time
Any idea how to design it in the design time too?
Based on Paul's answer I would not say that CarObj is zero , Because exceptions will be thrown during runtime. I suggest changing your converter as follows: Public Object Convert (Object Value, Type Target Type, Object Parameter, System. Globalization.CultureInfo Culture) {if (ApplicationIsInDesignMode) {Return Visibility. ** you like ***; } If (hbbcostoffer page. Isec == true & amp; amp; hubbCostOfferPage.CarObj.TestApprovedDate == blank) return visibility. Visible; Again go back to visibility. Collapsed; } Private Static Bull ApplicationIsInDesignMode {get {return (bool) (Designer properties .isidiginemodipoporty.getmatetadata (typef (dependency object)). DefaultValue; }}
Comments
Post a Comment