ModuleName.UserUIExtensions

Nov 18, 2009 at 6:25 AM

took a look at the ExtensibleGrid.Extensions sample

I have one question around that issue of extentions with UI.
the current implementation:

        void OKButton_Click(object sender, RoutedEventArgs e)
        {
            foreach (var extensionItem in extensionItems)
            {
                if (extensionItem.Enabled == true && extensionItem.Activated == false)
                {
                    var extension = extensionItem.GridExtension.Value;
                    extension.Initialize(this);
                    extensionItem.Activated = true;
                }
            }
            
        }

shouldn't it be:

var extension = extensionItem.GridExtension.Value;
                if (extensionItem.Enabled)
                {
                    extension.Initialize(this);
                }
                else
                {
                    extension.DeInitialize(this);
                }

Internally:
Initialize
DeInitialize

will save this original state before making ui changes
and deinitialize will restore initial ui changes. http://www.dofactory.com/patterns/patternmemento.aspx#_self2
current form is a little cheesy since it doesn't disable effects. : ]


I see this sample as an opportunity to create UserUIExtensions to persist ui positions of windows, loaded modules of a silverlight application... has anyone attempted this?


thumbs up for awesome framework you guys are building!
lm