示例#1
0
        private void OnSlideThumbnailClicked
        (
            object sender,
            EventArgs arguments
        )
        {
            PortableBaseObject selectedObject = null;

            try
            {
                ImageView slideThumbnail = (ImageView)sender;

                FrameLayout backgroundFrame = slideThumbnail.GetParentView <FrameLayout>();
                FrameLayout innerFrame      = backgroundFrame.GetParentView <FrameLayout>();
                FrameLayout outerFrame      = innerFrame.GetParentView <FrameLayout>();
                ViewGroup   sourceView      = outerFrame.GetParentView <ViewGroup>();

                int itemPosition = (int)sourceView.Tag;

                KeyValuePair <PortableBaseSource, int> selectedSource = this[itemPosition];

                PortableBaseSource objectSource = selectedSource.Key;
                int objectIndex = selectedSource.Value;

                selectedObject = objectSource.SourceObjects[objectIndex];
            }
            catch (Exception exception)
            {
                AndroidCrapApplication.ApplicationLogger.LogError(exception);

                throw;
            }

            if (selectedObject != null)
            {
                EditObject(selectedObject);
            }
        }