سؤال

As a workaround for the way Silverlight loads resources, I implemented the solution posted here: Silverlight Shared MergedDictionaries

This works fine, but it's annoying having to comment out the resource dictionaries in the app.xaml. I need to comment them to run the app, but uncommenting them lets me get a design view.

I am sure there's a way to get the app to not load these, but I'm not much of a dev. Can somebody point me to a tutorial or example? Some googling hasn't turned up anything. Thanks!

هل كانت مفيدة؟

المحلول

I found a simple answer: comment out InitializeComponent in App().

Looking at the code in App.g.i.cs:

        public void InitializeComponent() {
        if (_contentLoaded) {
            return;
        }
        _contentLoaded = true;
        System.Windows.Application.LoadComponent(this, new System.Uri("/SLPortalResources;component/App.xaml", System.UriKind.Relative));
    }

Since this just loads what's in app.xaml, commenting it out works: the app runs and you get a design view.

Is there anything wrong with doing this?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top