Kinnara / WPToolkit

A fork of Windows Phone Toolkit. A better Windows Phone Toolkit.
Microsoft Public License
66 stars 29 forks source link

ElementScrollingHost, ElementItemsPresenter are getting null #14

Closed pallammadhukar closed 10 years ago

pallammadhukar commented 10 years ago

Hi, i copied all FlipView Control of your toolkit into my project. I have debugged both your sample and my sample i am getting ElementScrollingHost =null ElementItemsPresenter=null In your sample your able to get.

Below method your where your assigned values:

public override void OnApplyTemplate() { _animator = null; ItemsHost = null; ItemsHostSize = new Size(double.NaN, double.NaN);

        if (ElementItemsPresenter != null)
        {
            LayoutUpdated -= OnLayoutUpdated;
        }

        base.OnApplyTemplate();

        ElementScrollingHost = GetTemplateChild(ElementScrollingHostName) as ScrollViewer;
        ElementItemsPresenter = GetTemplateChild(ElementItemsPresenterName) as ItemsPresenter;

        if (ElementItemsPresenter != null)
        {
            InitializeItemsHost();

            if (ItemsHost == null)
            {
                LayoutUpdated += OnLayoutUpdated;
            }
        }
    }

I am not getting why those values are null. sample running without error. but i am getting following output: output

Kinnara commented 10 years ago

You need to include the default style in generic.xaml as well.

pallammadhukar commented 10 years ago

thanks. it worked perfectly.