Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 91519 articles
Browse latest View live

INotificationPropertyChanged

$
0
0

Hi all,

I'm implementing INotificationPropertyChanged

Action act = new Action ();
public Action Action
{
get { return act; }
set
{
if (value == act)
return;
act = value;
OnPropertyChanged("Action");
}
}

public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
{
var handler = PropertyChanged;
if (handler == null)
return;
handler(this, new PropertyChangedEventArgs(propertyName));
}

and updating class object;

Action=new Action();
Action=SomeList.FirstOrDefault();

after this statement loop entering into OnPropertyChanged but PropertyChanged event value is returning null, and not updating the property.

do I need to initialize PropertyChanged event anywhere, please help me


Tabbed Chlid Page OnApearing Invoking Twice

$
0
0

Hey Guys

I'm using TabbedPage having two child inside e.g. A and B (XAML)

Now when I'm navigating to TabbedPage so, A page OnAppearing invoking two time which my default page in tab. is this the default behavior in tab or I'm doing something wrong ?

Thanks

Not found NavigationPageRenderer.cs

$
0
0

Good afternoon.
I have a problem with a cross platform project.
I get a message that does not find the file NavigationPageRenderer.cs and then tells me:

"System.MissingMethodException: Method 'Android.Support.V4.Widget.DrawerLayout.AddDrawerListener' not found."

What is the solution to this error.
regards

How i can do padding like this?

$
0
0

How i can do padding like stack layout with white background ?
~~~~
I have all, but not padding for stacklayout with white backgound.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="***.View.DiscussionsPage"
             xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
             BackgroundColor="#e2f2f7">
  <ScrollView>
    <StackLayout Spacing="12">
      <StackLayout BackgroundColor="#615F5F" Orientation="Horizontal" VerticalOptions="Start" >
        <!--...-->
      </StackLayout>
      <StackLayout BackgroundColor="White">
        <StackLayout.Padding>
          <Thickness Right="5" Left="5" Top="5" Bottom="5"/>
        </StackLayout.Padding>
      </StackLayout>
    </StackLayout>
  </ScrollView>
</ContentPage>

Batch icon in the toolbar

$
0
0

Hi

In my project i need to display batch icon on top of the toolbar item, i have no clue how to achieve this.
Can any one suggest or point me to the right solution.

Please see the screen shot for the more information.

Refreshing the list view to the starting of the page

$
0
0

Hi

I have a list view with pagination of 100 items and a refresh button to refresh the contents.

The issue is i scrolled down to some items(for eg:30) and click on refresh button where iam calling an api and new values are binded to an observable collection.But the issue the item values are getting changed but the page is there at 30th item and it is not in the 1st cell position.

How can i change that to the starting of page?

How to bind HTML String to WebView?

$
0
0

I've got a bindable string that's populated with HTML.

    public string Description
    {
        get { return _description; }
        set
        {
            _description = value;
            OnPropertyChanged();
        }
    }

Now I'd like that string to be bound to a webview

  <WebView Source="{Binding Description}" VerticalOptions ="FillAndExpand"/>

but this isn't working. Unfortunately the Docs for WebViewSource hasn't been entered yet.

How can I bind a string of HTML to a WebView?

Xamarin.Forms Android rounded button

$
0
0

Hello,

I am trying to create buttons with rounded corners on Android. The following code does not work :
< Button Text="MyText" BorderRadius="25" HeightRequest="50"/ >

Is there a way to obtain rounded corners on button without a custom renderer ?


Create a Image ProgressBar

$
0
0

Hello everyone! My name's An, i'm a newbie with xamarin form. Now i have some trouble about how to create a image ProgressBar!
Anyone can give me any idea to resolve it, plz?
Thanks so much for helping me!

M2MQTT in Xamarin forms or Xamarin Android

$
0
0

i am unable to Integrate the M2MQTT in xamarin forms or Xamarin Android .

Getting errors while creating a new Blank Xaml App (Xamarin.Forms Shared) project

$
0
0

I'm trying to create a new Blank Xaml App (Xamarin.Forms Shared) project, and getting the below 18 errors.
Is that normal?? Anything I can do to fix that?

Error CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 1 Active
Error CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 2 Active
Error CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 3 Active
Error CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 4 Active
Error CS0246 The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?) App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 6 Active
Error CS0246 The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?) App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 10 Active
Error CS0518 Predefined type 'System.Void' is not defined or imported App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 12 Active
Error CS0518 Predefined type 'System.Void' is not defined or imported App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 19 Active
Error CS0115 'App.OnStart()': no suitable method found to override App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 19 Active
Error CS0518 Predefined type 'System.Void' is not defined or imported App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 24 Active
Error CS0115 'App.OnSleep()': no suitable method found to override App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 24 Active
Error CS0518 Predefined type 'System.Void' is not defined or imported App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 29 Active
Error CS0115 'App.OnResume()': no suitable method found to override App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 29 Active
Error CS0518 Predefined type 'System.Object' is not defined or imported App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 14 Active
Error CS0103 The name 'InitializeComponent' does not exist in the current context App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 14 Active
Error CS0518 Predefined type 'System.Object' is not defined or imported App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 16 Active
Error CS0118 'MainPage' is a type but is used like a variable App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 16 Active
Error CS0518 Predefined type 'System.Object' is not defined or imported App1.UWP d:\Data\Projects\Xamarine\another test\App1\App1\App1\App.xaml.cs 16 Active

Don't work padding in stacklayout

$
0
0

Hi. Don't work padding in stacklayout. I have:

<StackLayout>
        <StackLayout>
          <!--It not have padding.-->
        </StackLayout>
        <StackLayout>
          <StackLayout.Padding>
            <Thickness Right="5" Left="5" Top="5" Bottom="5"/>
          </StackLayout.Padding>
          <!--It must have padding-->
       </StackLayout>
</StackLayout>

Why it's not working?

An Image inside a Grid makes it expand to fill full height.

$
0
0

Please consider the following XAML:

<?xml version="1.0" encoding="utf-8"?>
    <ContentPage
            xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            x:Class="MyNamespace.MainPage">
        <ContentPage.Padding>
            <OnPlatform
                x:TypeArguments="Thickness"
                    iOS="0, 20, 0, 0" />
        </ContentPage.Padding>
        <Grid
                VerticalOptions="Start"
                BackgroundColor="Red">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="50*" />
                <ColumnDefinition Width="50*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="150" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label
                    Grid.Column="0"
                    Grid.Row="0"
                    Grid.ColumnSpan="2"
                    Text="Post #1" />
            <!--Image
                    Grid.Column="0"
                    Grid.Row="1"
                    Aspect="AspectFit"
                    BackgroundColor="Lime"
                    Source="http://www.w3schools.com/css/img_fjords.jpg" /-->
            <Label
                    Grid.Column="0"
                    Grid.Row="1"
                    BackgroundColor="Silver"
                    Text="1" />
                <Label
                    Grid.Column="1"
                    Grid.Row="1"
                    Grid.RowSpan="2"
                    BackgroundColor="Olive"
                    Text="Post #1 text text text text text text text text text text text text text text xt text text text text text text text text text text text text text text text text text text text xt text text text text text text text" />
            <Label
                    Grid.Column="0"
                    Grid.Row="2"
                    BackgroundColor="Silver"
                    Text="2" />
        </Grid>
    </ContentPage>

If Label is displayed in col=0, row=1, it works perfect (see the first screen). But If you switch it to Image instead, Grid behaves strange, filling the whole page (see the second screen).

Rich Text Editor

$
0
0

@JamesMontemagno I searched and gone through a lot of stuff to find this kind of component but all in vain. If you know anything about this PLEASE HELP.

Is there a rich text editor component for use in Xamarin.Forms apps (including for Windows)?

$
0
0

Does anybody know of a rich text editor component for use in Xamarin.Forms apps (including for Windows)?

Many thanks,

John H.


Xamarin.Forms 2.3.4.184-pre1

$
0
0

We've pushed Xamarin.Forms 2.3.4.184-pre1 to nuget. To install the pre-release, check the pre-release option in your nuget manager and install this version.

If you’ve got a bug to report, drop us a quick report here so we can troubleshoot in detail.

Important notes

  • Xamarin.Forms 2.3.4 depends on a Xamarin installation of Cycle 8. Users upgrading from Xamarin.Forms 2.3.3 (or earlier) will experience numerous compile errors if they attempt to build without first upgrading their Xamarin installation.

  • When upgrading Xamarin.Forms, take care not to simply "update all" as that will update the Xamarin.Android.Support packages to an incompatible version. More info here.

2.3.4.184-pre1

For all the details, please read the release post here. There is SO much goodness in this release, it's actually too long for the forum.

NavigationPage example

$
0
0

Hi All

I've noticed that all examples of NavigationPage in both docs and samples gallery are actually a ContentPage - which is surprising.

Do we have any examples of the use of NavigationPage ?

Thanks

Dean

How do I not show the navigation bar at the root of a navigation stack?

$
0
0

So I have a NavigationPage. The root is a scrolling list, but I don't need the navigation bar for it, so I'd like to hide it. But when I push detail pages on to the navigation stack, I want to show the navigation bar for those. What's the best way to achieve this?

I noticed a NavigationPage.SetHasNavigationBar(navigationPage, false) but it does not seem to do anything to navigationPage which still shows the navigation bar as always.

In Objective C I just overrode the methods of the view controller like so:

- (void)viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}

In Xamarin I'm trying something like this:

NavigationPage.SetHasNavigationBar(navigationPage, false);
control.ItemSelected += async (sender, e) => {
    NavigationPage.SetHasNavigationBar(navigationPage, true);
    await navigationPage.PushAsync(GetDetailsPage(e.ItemId));
    NavigationPage.SetHasNavigationBar(navigationPage, false);
};

Thanks for any help!

Navigation page to page in master detail page.

$
0
0

Hi All,

I am facing an issue while press OnBackButtonPressed() in xamarin forms.
Let's I am explainig what I want.
I have one MasterPage and one MasterDetailPage

And I have 5 ContentPage
1.) Page1
2.) Page2
3.) Page3
4.) Page4
5.) Page5

MasterPage contain NavigationDraware Menu.
Each page is listed in Menu.

Please find out below code, For Naviagation one page to another page.
void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = e.SelectedItem as MasterPageItem;
if (item != null)
{
Detail = new NavigationPage((Page)Activator.CreateInstance(item.TargetType));
masterPage.ListView.SelectedItem = null;
IsPresented = false;
}
}

BackNavigation event is listed in Page1.
protected override bool OnBackButtonPressed()
{
this.Navigation.PushAsync(new NavigationPage(new Page2()));
return base.OnBackButtonPressed();
}

But I am not able to Navigate Page1 to Page2.

Xamarin.Forms Label won't word wrap inside a Grid

$
0
0

I define a Grid like this:

var easyGrid = new Grid();
easyGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
easyGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });

I then populate the Grid with text and bullets (emulating a bulleted list) like so:

for (int i = 0; i < bullets.Length; i++) {
    easyGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });

    var label = new Label { Text = "•" };
    label.SetValue(Grid.RowProperty, i);
    easyGrid.Children.Add(label);

    var text = new Label { Text = bullets[i] };
    text.SetValue(Grid.RowProperty, i);
    text.SetValue(Grid.ColumnProperty, 1);
    easyGrid.Children.Add(text);
}

But on iOS the Label controls don't word wrap as they do outside a Grid layout control. Is this a bug with Xamarin.Forms on iOS? Otherwise how do I get them to word-wrap?

Viewing all 91519 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>