コード例 #1
0
        void ChangeFontIconColor(VisualElement child, bool isSelected)
        {
            var imageCategory = child.FindByName <Label>("ImageCategory");
            var labelCategory = child.FindByName <Label>("LabelCategory");

            string visualState = isSelected ? "Selected" : "Normal";

            VisualStateManager.GoToState(imageCategory, visualState);

            homeViewModel.GetItemsForCategory(labelCategory.Text, isSelected);
        }
コード例 #2
0
        void SetupUserInterface()
        {
            //UIView a = this.NativeView;
            //Type type =  a.GetType();
            //PropertyInfo[] infos = type.GetProperties();

            var centerButtonX = View.Bounds.GetMidX() - 35f;
            var topLeftX      = View.Bounds.X + 25;
            var topRightX     = View.Bounds.Right - 65;
            var bottomButtonY = View.Bounds.Bottom - 150;
            var topButtonY    = View.Bounds.Top + 15;
            var buttonWidth   = 70;
            var buttonHeight  = 70;


            liveCameraStream = new UIView()
            {
                Frame = new CGRect(0f, 0f, 320f, View.Bounds.Height)
            };



            takePhotoButton = new UIButton()
            {
                Frame = new CGRect(centerButtonX, bottomButtonY, buttonWidth, buttonHeight)
            };
            takePhotoButton.SetBackgroundImage(UIImage.FromFile("TakePhotoButton.png"), UIControlState.Normal);

            toggleCameraButton = new UIButton()
            {
                Frame = new CGRect(topRightX, topButtonY + 5, 35, 26)
            };
            toggleCameraButton.SetBackgroundImage(UIImage.FromFile("ToggleCameraButton.png"), UIControlState.Normal);

            toggleFlashButton = new UIButton()
            {
                Frame = new CGRect(topLeftX, topButtonY, 37, 37)
            };
            toggleFlashButton.SetBackgroundImage(UIImage.FromFile("NoFlashButton.png"), UIControlState.Normal);


            //tmp.Add(tmp);

            View.Add(liveCameraStream);
            Picker newpicker = MainPage.FindByName <Picker>("CropPicker");
            double x         = newpicker.X;

            View.Add(ConvertFormsToNative(newpicker, new CGRect(View.Bounds.Location.X / 2, View.Bounds.Location.Y / 2, 150, 35)));
            View.Add(takePhotoButton);
            View.Add(toggleCameraButton);
            View.Add(toggleFlashButton);
        }
コード例 #3
0
        private static object FindByNameMemberImpl(IBindingMemberInfo bindingMemberInfo, VisualElement target, object[] arg3)
        {
            var name = (string)arg3[0];

            return(target.FindByName <object>(name));
        }