Class's ContentPage Question

Jassim Al Rahma 1,566 Reputation points
2022-08-25T23:00:32.283+00:00

Hi,

I am trying to create a ContentPage in a MAUI Class Library using the below but it's not working.

namespace MyClass  
{  
    // All the code in this file is included in all platforms.  
    public class MyAuth  
    {  
        public static Page Signin()  
        {  
            Grid grid = new Grid  
            {  
                RowDefinitions =  
                    {  
                        new RowDefinition { Height = new GridLength(50) },  
                        new RowDefinition { Height = new GridLength(1, GridUnitType.Star) },  
                        new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }  
                    }  
            };  
  
            return new ContentPage  
            {  
                Content = grid;  
            };  
        }  
    }  
}  

Kindly help..

Thanks,
Jassim

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,412 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,844 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.