Edit and use Xamarin.Forms source code from GitHub in Visual Studio

Is it possible to edit the xamarin.forms open-source code here: https://github.com/xamarin/Xamarin.Forms and then use it like you normally would when creating a xamarin.forms app? Please provide steps on how to do this if possible.

Best Answer

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Don't you already have 5 comments for this same question on your other thread from yesterday?
    https://forums.xamarin.com/discussion/120213/editing-and-using-the-xamarin-forms-source-code#latest

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Basically, my goal would be to change the PhoneMasterDetailRenderer in order to change the width value of the Master page. (It is a percentage of the screen, which is 0.8, and so by changing that it should adjust the size of the master?)

    How about just making a CustomRenderer? That's the documented way to deal with such things and the way the other million Xamaring developers do things. You don't really think that the rest of the world makes all their own customized source code just to change the layout a little bit... Do you?

  • Daniel.LochnerDaniel.Lochner ZAMember ✭✭
    edited January 2018

    @ClintStLaurent said:

    Basically, my goal would be to change the PhoneMasterDetailRenderer in order to change the width value of the Master page. (It is a percentage of the screen, which is 0.8, and so by changing that it should adjust the size of the master?)

    How about just making a CustomRenderer? That's the documented way to deal with such things and the way the other million Xamaring developers do things. You don't really think that the rest of the world makes all their own customized source code just to change the layout a little bit... Do you?

    Hello, and yes I have tried customrenderers, but I can't seem to get it right. The problem is that most people don't follow up and respond. People only see the latest questions and leave the older threads. I have spent an entire month on the MasterDetailPage and I'm getting extremely tired of this. Please help :(

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @Daniel.Lochner said:

    @ClintStLaurent said:

    Basically, my goal would be to change the PhoneMasterDetailRenderer in order to change the width value of the Master page. (It is a percentage of the screen, which is 0.8, and so by changing that it should adjust the size of the master?)

    How about just making a CustomRenderer? That's the documented way to deal with such things and the way the other million Xamaring developers do things. You don't really think that the rest of the world makes all their own customized source code just to change the layout a little bit... Do you?

    Hello, and yes I have tried customrenderers, but I can't seem to get it right. The problem is that most people don't follow up and respond. People only see the latest questions and leave the older threads. I have spent an entire month on the MasterDetailPage and I'm getting extremely tired of this. Please help :(

    From your original thread it appears that you just want to increase the width of the Master window. What you want to make it, 0.9 or 0.95?

    Probably some string is not fitting in one line, am I right?

    If your answer to above question is 'Yes' then I see that you were not successful in making it happen and you are frustrated. I always follow one principle...If mountain doesn't come to me, I will go to the mountain. Normally the sliding page is expected to take only a portion of the page that it covers and the pros decided that 0.8 is an optimal value. So if your data is not fitting the way you want, then you should trim it to that fits in it. Probably you can adjust the font to fit it. This you must be knowing and may already in cards...so don't get yourself frustrated. If the Master-Detail Page is not meeting your requirement, then go to the old model of Menu List -> Item Details model.

  • Daniel.LochnerDaniel.Lochner ZAMember ✭✭
    edited February 2018

    @ShantimohanElchuri said:

    @Daniel.Lochner said:

    @ClintStLaurent said:

    Basically, my goal would be to change the PhoneMasterDetailRenderer in order to change the width value of the Master page. (It is a percentage of the screen, which is 0.8, and so by changing that it should adjust the size of the master?)

    How about just making a CustomRenderer? That's the documented way to deal with such things and the way the other million Xamaring developers do things. You don't really think that the rest of the world makes all their own customized source code just to change the layout a little bit... Do you?

    Hello, and yes I have tried customrenderers, but I can't seem to get it right. The problem is that most people don't follow up and respond. People only see the latest questions and leave the older threads. I have spent an entire month on the MasterDetailPage and I'm getting extremely tired of this. Please help :(

    From your original thread it appears that you just want to increase the width of the Master window. What you want to make it, 0.9 or 0.95?

    Probably some string is not fitting in one line, am I right?

    If your answer to above question is 'Yes' then I see that you were not successful in making it happen and you are frustrated. I always follow one principle...If mountain doesn't come to me, I will go to the mountain. Normally the sliding page is expected to take only a portion of the page that it covers and the pros decided that 0.8 is an optimal value. So if your data is not fitting the way you want, then you should trim it to that fits in it. Probably you can adjust the font to fit it. This you must be knowing and may already in cards...so don't get yourself frustrated. If the Master-Detail Page is not meeting your requirement, then go to the old model of Menu List -> Item Details model.

    Hey, thank you for your response :)

    The main reason why I want to adjust the width of the Master-Detail Page, is in order to decrease it on the iPad.

    Most iOS apps out there currently have an effect like https://github.com/Clancey/FlyoutNavigation where the Detail Page gets pushed to the right when the Master is expanded. Then there is a shadow effect ontop of the master to appear as if it is being revealed - This is what I am going for, but I cannot seem to get it right in xamarin.forms.

    What I did instead was:
    1. For the "Push" effect:
    I created a custom renderer for the MasterDetailPage inheriting from PhoneMasterDetailRenderer, and then set the InteractivePopGestureRecognizer to false:

     [assembly: ExportRenderer(typeof(MainPage), typeof(MainPageRenderer))]
     namespace Project.iOS.Main
     {
         public class MainPageRenderer : MyPhoneMasterDetailRenderer
         {
             public override void ViewDidAppear(bool animated)
             {
                 base.ViewDidAppear(animated);
                 var navctrl = this.ViewController.NavigationController;
                 try
                 {
                     navctrl.InteractivePopGestureRecognizer.Enabled = false;
                 }
                 catch { }
             }
         } 
     }
    

    2. For the "Shadow" effect:
    For this effect, I eventually used this: https://stackoverflow.com/questions/42455594/xamarin-forms-add-shadow-on-masterdetailpage-content-page. The problem about this solution, is that the shadow effect gets attached to the DetailPage, and so the default for the iPad MasterDetailPage is an overlay effect... where the MasterPage expands ontop of the Detail (The DetailPage does not move to the right like on the iPhone). And so in order to achieve this effect, I made the iPad act like an iPhone.

    The problem about all of this is that the Master covers now 80% of the screen, like an iPhone, and all I want to do is decrease this size.

    I am willing to try absolutely anything your suggest because I am so desperate right now! I seriously have spent an entire month on this, and when I came up with the above solution 2 days ago - I thought I had figured it out... but I hadn't...

    Thanks,
    Daniel

  • Daniel.LochnerDaniel.Lochner ZAMember ✭✭
    Accepted Answer

    For all those interested, I just got my answer on StackOverflow here :)

Sign In or Register to comment.