Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ';System.ArgumentException';发生在Xamarin.Forms.Platform.UAP.dll中_C#_Xamarin_Xamarin.forms_Windows 10 Universal_Xamarin.windows - Fatal编程技术网

C# ';System.ArgumentException';发生在Xamarin.Forms.Platform.UAP.dll中

C# ';System.ArgumentException';发生在Xamarin.Forms.Platform.UAP.dll中,c#,xamarin,xamarin.forms,windows-10-universal,xamarin.windows,C#,Xamarin,Xamarin.forms,Windows 10 Universal,Xamarin.windows,您好,我创建了xamarin表单项目并实现了MasterDetailPage。它在android和ios中运行良好,没有任何问题,但我遇到了适用于windows 10的UWP项目。它抛出异常,应用程序崩溃。请找到我的踪迹 Xamarin.Forms.Platform.UAP.dll中出现“System.ArgumentException” at Windows.Foundation.Size..ctor(Double width, Double height) at Xamarin.

您好,我创建了xamarin表单项目并实现了MasterDetailPage。它在android和ios中运行良好,没有任何问题,但我遇到了适用于windows 10的UWP项目。它抛出异常,应用程序崩溃。请找到我的踪迹

Xamarin.Forms.Platform.UAP.dll中出现“System.ArgumentException”

   at Windows.Foundation.Size..ctor(Double width, Double height)
   at Xamarin.Forms.Platform.UWP.MasterDetailControl.get_DetailSize()
   at Xamarin.Forms.Platform.UWP.MasterDetailPageRenderer.UpdateBounds()
   at Xamarin.Forms.Platform.UWP.MasterDetailPageRenderer.OnIsPaneOpenChanged(DependencyObject sender, DependencyProperty dp)
   at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Xamarin.Forms.Platform.UWP.MasterDetailPageRenderer.UpdateIsPresented()
   at Xamarin.Forms.Platform.UWP.MasterDetailPageRenderer.OnElementPropertyChanged(Object sender, PropertyChangedEventArgs e)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at Xamarin.Forms.BindableObject.OnPropertyChanged(String propertyName)
   at Xamarin.Forms.Element.OnPropertyChanged(String propertyName)
   at Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent)
   at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes)
   at Xamarin.Forms.MasterDetailPage.UpdateMasterBehavior(MasterDetailPage page)
我的代码

public class MasterHomePage : MasterDetailPage, MasterHomePageLisener
    {
        public MasterHomePage()
        {
            Title = AppRex.home;
            Icon = "hamburger.png";
            HomePageItem[] homePageItems =
                {
                new HomePageItem(AppRex.home, "home_icon.png", typeof(AfterLoginHomePage)),
                 new HomePageItem(AppRex.changePassword, "change_password_icon.png", typeof(ChangePassword)),
                new HomePageItem("Set / Change PIN", "change_pin.png", typeof(LoginPinSetUpPage)),
                new HomePageItem(AppRex.customerSuppoert, "support_icon.png", typeof(CustomerSupport)),
                new HomePageItem(AppRex.about, "about_icon.png", typeof(AboutPage)),
                new HomePageItem(AppRex.checkUpdate, "updates_icon.png", typeof(CheckUpdatedPage)),
                new HomePageItem("Tutorial", "video_icon.png", typeof(TutorialVideoPage)),
                  new HomePageItem(AppRex.logout, "logout_icon.png", null),                  
                };
            this.Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
            ListView list = new ListView
            {
                ItemsSource = homePageItems,                
                ItemTemplate = new DataTemplate(() =>
                {
                    var imageCell = new LeftMenuCell();
                    imageCell.SetBinding(LeftMenuCell.TitleProperty, "Name");
                    imageCell.SetBinding(LeftMenuCell.ImageProperty, "IconSource");
                    return imageCell;
                }),
                VerticalOptions = LayoutOptions.FillAndExpand,
            };


            //Left menu 
            this.Master = new EgnatiumFull.Views.MyContentPage
            {
                Title = AppRex.home,
                Content = new StackLayout { Children = { new Image() { Source = App.GetLogoImg()} ,
                        new MyLabel{Text = AppRex.version, HorizontalTextAlignment = TextAlignment.Center},
                        new MyLabel{Text = App.UserName, FontSize = 24, FontAttributes= FontAttributes.Bold},
                        new MyLabel{Text = App.UserEmailId},
                        new BoxView { BackgroundColor = Color.Gray, HeightRequest = 1}, list }
                }
            };
            this.Detail = new AfterLoginHomePage(this);
            if (Device.OS == TargetPlatform.WinPhone)
            {
                (this.Detail as EgnatiumFull.Views.MyContentPage).Content.GestureRecognizers.Add(
                    new TapGestureRecognizer((view) =>
                    {
                        this.IsPresented = true;
                    }));
            }

            // Define a selected handler for the ListView.
            list.ItemTapped += async(sender, args) =>
            {
                var homePageItem = ((HomePageItem)args.Item);
                var type = homePageItem.TargetType;
                if (type == null)
                {
                    if (homePageItem.Name.Equals(AppRex.logout))
                    {
                        list.SelectedItem = null;
                        var resp = await DisplayAlert("","Are you sure want to Logout?","Yes", "No");
                        if (resp)
                        {
                            await App.UpdateLoginStatus(true);


                            Application.Current.MainPage = App.GetPage();
                        }
                    }
                }
                else {
                    Page page = null;
                    if (type.Equals(typeof(AfterLoginHomePage)))
                    {
                        page = new AfterLoginHomePage(this);
                    }
                    else if (type.Equals(typeof(AboutPage)))
                    {
                        page = new AboutPage(this);
                    }
                    else if (type.Equals(typeof(ChangePassword)))
                    {
                        page = new ChangePassword(this);
                    }
                    else if (type.Equals(typeof(LoginPinSetUpPage)))
                    {
                        page = new LoginPinSetUpPage(App.UserId, App.UserEmailId, this);
                    }
                    else if (type.Equals(typeof(TutorialVideoPage)))
                    {
                        page = new TutorialVideoPage(this);
                    }
                    else if (type.Equals(typeof(CustomerSupport)))
                    {
                        page = new CustomerSupport(this);
                    }
                    else if (type.Equals(typeof(CheckUpdatedPage)))
                    {
                        page = new CheckUpdatedPage(this);
                    }
                    page.Title = ((HomePageItem)args.Item).Name;
                    Detail = page;
                }
                // Show the detail page.
                this.IsPresented = false;
                ((ListView)sender).SelectedItem = null;
            };

            // Initialize the ListView selection.
            //list.SelectedItem = homePageItems[0];


        }

        public void HomeIconClicked()
        {
            this.Detail = new AfterLoginHomePage(this);
        }

        public void MenuIconClicked()
        {
            this.IsPresented = !this.IsPresented;
        }
    }

    public interface MasterHomePageLisener
    {
        void MenuIconClicked();
        void HomeIconClicked();

    }

你能出示你的密码吗?嗨,你需要哪种密码?你需要我的母版详细页代码吗?是的,母版详细页代码。请检查我的code@NicoZhu-MSFT那么你找到什么了吗?你已经看了超过7周的代码。。。