bitfoundation / bitplatform

Build all of your apps using what you already know and love ❤️
https://bitplatform.dev
MIT License
1.07k stars 222 forks source link

Error On x:Name="ElementName" (Xamarin.Forms) #428

Closed matinfathi19 closed 3 years ago

matinfathi19 commented 3 years ago

I have a problem on set x:Name="Element1" For all Bit controls

everything is ok with this code below (Page.Xaml)

<bit:BitDateTimePicker   
    Culture="Fa"
    DateTimeDisplayFormat="dd MMM yyyy"
    FlowDirection="RightToLeft"
    CalendarSystem="{x:Static noda:CalendarSystem.PersianArithmetic}" />

But the build would fail on the following statement:

<bit:BitDateTimePicker   
    x:Name="Element1"
    Culture="Fa"
    DateTimeDisplayFormat="dd MMM yyyy"
    FlowDirection="RightToLeft"
    CalendarSystem="{x:Static noda:CalendarSystem.PersianArithmetic}" />

error

the following 2 errors appeared: 1- InitializeComponent() at the constructor of Page.cs 2- in Page.xaml

I want to set the property Name for the element to get the current value By "this.ElemntName.Text"

Any Idea?

msynk commented 3 years ago

I edited the issue's description in order to improve its clearness

ysmoradi commented 3 years ago

It's an issue with XF itself. Please use regular usings in your xaml instead of xmlns:bit="https://bit..." Or better, use MVVM approach

matinfathi19 commented 3 years ago

MVVM approach Solved The Problem. What do you mean of 'regular using'?

matinfathi19 commented 3 years ago

Hi Agin Loock At This Code In Page.Xaml which every thing is ok Untitled And Now This One In Page.CS Untitled2 When Move Codes To .CS The Attribute Calender System Dosnt Work As I Said Before I Forced To Create MyCalender In .CS File Becuse Couldnt Set The X:Name="BitAZ" in .Xaml File And Then Call It By This.BitAZ But in .CS File I Would Have This.BitAz Without Problem. Help Bro.

matinfathi19 commented 3 years ago

any idea?????

rypedram commented 3 years ago

https://github.com/bitfoundation/bitframework/issues/195#issuecomment-660788466 https://github.com/bitfoundation/bitframework/issues/179#issuecomment-569955092

matinfathi19 commented 3 years ago

#195 (comment) #179 (comment)

Thanks It Solved Problem