RadPhoneApplicationFrame and Caliburn.Micro

6 posts, 1 answers
  1. Albert
    Albert avatar
    5 posts
    Member since:
    Feb 2012

    Posted 10 Feb 2012 Link to this post

    Hello, i want to use the RadPhoneApplicationFrame with Caliburn Micro:
    if i initialize RootFrame in App.xaml like this:
    RootFrame = new RadPhoneApplicationFrame();
    CM's INavigationService RootFrame property type is PhoneApplicationFrame 

    if i renew RootFrame property in AppBootstrapper, View --> ViewModel databinding doen't work :(
    but CM's INavigationService RootFrame property type is RadPhoneApplicationFrame 

    public class AppBootstrapper : PhoneBootstrapper
    {
        private PhoneContainer container;
     
        private new PhoneApplicationFrame RootFrame { get; set; }
     
        protected override void Configure()
        {
            RootFrame = new RadPhoneApplicationFrame();
            container = new PhoneContainer(RootFrame);
     
            container.RegisterPhoneServices();
            container.PerRequest<MainViewModel>();
        }
    }
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 13 Feb 2012 Link to this post

    Hi Albert,

    Can you please send us a runnable project where we can debug the problem.

    The difference between the RadPhoneApplicationFrame and PhoneApplicationFrame is that the content of the Telerik frame is a RadTransitionControl.

    This may be a reason for your problem with Caliburn, but we want to make sure that we will address the correct problem. Please send us a very simple sample project where your problem is identified.

    Greetings, Valentin.Stoychev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Albert
    Albert avatar
    5 posts
    Member since:
    Feb 2012

    Posted 13 Feb 2012 Link to this post

    There is a sample code
  5. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 14 Feb 2012 Link to this post

    Hello Albert,

    The problem is in the AppBootstrapper - here is the updated working version. Please let us know if you need more help.
    public class AppBootstrapper : PhoneBootstrapper
        {
            private PhoneContainer container;
     
            private PhoneApplicationFrame rootFrame;
            private new PhoneApplicationFrame RootFrame {
                get
                {
                    if (this.rootFrame == null)
                    {
                        this.rootFrame = new RadPhoneApplicationFrame();
                    }
                    return this.rootFrame;
                }
                set
                {
                    this.rootFrame = value;
                }
            }
     
            protected override void Configure()
            {
                // Here i wanna init Rad frame, but if u uncomment this code, data binding and navigation does not work
     
                container = new PhoneContainer(RootFrame);
     
                container.RegisterPhoneServices();
                container.PerRequest<MainViewModel>();
                container.PerRequest<SecondViewModel>();
     
                AddCustomConventions();
            }
     
            protected override object GetInstance(Type service, string key)
            {
                return container.GetInstance(service, key);
            }
     
            protected override IEnumerable<object> GetAllInstances(Type service)
            {
                return container.GetAllInstances(service);
            }
     
            protected override void BuildUp(object instance)
            {
                container.BuildUp(instance);
            }
     
            public static void AddCustomConventions()
            {
            }
     
            protected override PhoneApplicationFrame CreatePhoneApplicationFrame()
            {
                return RootFrame;
            }


    Regards, Valentin.Stoychev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Albert
    Albert avatar
    5 posts
    Member since:
    Feb 2012

    Posted 14 Feb 2012 Link to this post

    Thanks, Valentin
  7. Derek
    Derek avatar
    39 posts
    Member since:
    Aug 2012

    Posted 14 Mar 2012 Link to this post

    This is what I do:

    protected override PhoneApplicationFrame CreatePhoneApplicationFrame()
           {
               return new RadPhoneApplicationFrame();
           }
Back to Top
DevCraft banner