This project is read-only.


V2 Not able to control visibility (Win8)



I'd like to control the Visibility of AdRotator V2 programically.
In my GamePage ctor I added:

public GamePage(string launchArguments)
        AdRotatorCtrl.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

The I got the exception:
An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll
Additional information: Object reference not set to an instance of an object.

Nothing meaningful found on the any thread's callstack.

Any ideas ?


Closed Jun 14, 2014 at 10:50 AM by Darkside
Settings now work as expected


Darkside wrote Sep 30, 2013 at 11:30 AM

Interesting, not come across that issue before in testing, definitely should not do that.

I'd recommend using the "IsAdRotatorEnabled" property instead of Visibility fro now, as it will alter the visibility based on that property accordingly as well as a bunch of other clean up tasks

Hope this helps

Koto wrote Oct 1, 2013 at 8:19 PM

Hi Darkside,

I did:
public MainPage()
        Win8AdRotator.PlatformAdProviderComponents.Add(AdRotator.Model.AdType.PubCenter, typeof(Microsoft.Advertising.WinRT.UI.AdControl));
        Win8AdRotator.Log += (s) => System.Diagnostics.Debug.WriteLine(s);

        Win8AdRotator.IsAdRotatorEnabled = false;
But when app starts Ads are still displayed.

Darkside wrote Oct 1, 2013 at 9:54 PM

Hmm, that should not be the case. I'll try and have a look at that tomorrow (unless you feel like delving)

Darkside wrote Jun 14, 2014 at 10:50 AM

in the next release both Visibility and IsAdRotatorEnabled work as expected.

Visibility will collapse area, IsAdRotatorEnabled will stop ads from displaying but won't affect display area.