Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:controls="clr-namespace:App.CustomControls"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:local="clr-namespace:app.CustomControls">
- <ContentPage.Content>
- <StackLayout Orientation="Vertical">
- <ContentView>
- <OnPlatform x:TypeArguments="View">
- <OnPlatform.Android>
- <local:CustomCalendarEvent/>
- </OnPlatform.Android>
- </OnPlatform>
- </ContentView>
- </StackLayout>
- </ContentPage.Content>
- </ContentPage>
- public class CustomCalendarEvent : View{ }
- [assembly: ExportRenderer(typeof(CustomCalendarEvent), typeof(CustomCalendarEventRenderer))]
- namespace App.Droid.CustomRenderers
- {
- public class CustomCalendarEventRenderer : ViewRenderer
- {
- protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.View> e)
- {
- base.OnElementChanged(e);
- if (Control == null)
- {
- try
- {
- var intent = new Intent(Forms.Context, typeof(Events));
- Forms.Context.StartActivity(intent);
- //var context = Xamarin.Forms.Forms.Context;
- //LayoutInflater inflater = context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater;
- //var _view = inflater.Inflate(Resource.Layout.EventView, this, false);
- //mWeekView = _view.FindViewById<WeekView>(Resource.Id.weekView);
- //SetNativeControl(_view);
- }
- catch (Exception ex)
- {
- string Message = ex.Message;
- }
- }
- }
- }
- public class Events : AppCompatActivity, WeekView.IEventClickListener, WeekView.IEventLongPressListener, MonthLoader.IMonthChangeListener
- {
- private SupportToolbar mToolbar;
- private static int TYPE_DAY_VIEW = 1;
- private static int TYPE_THREE_DAY_VIEW = 2;
- private static int TYPE_WEEK_VIEW = 3;
- private int mWeekViewType = TYPE_THREE_DAY_VIEW;
- private WeekView mWeekView;
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- // Set our view from the "main" layout resource
- SetContentView(Resource.Layout.EventView);
- ---
- ----------
- ---
- ----------
- ---
- ----------
- }
- }
Add Comment
Please, Sign In to add comment