Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

MaterialTextField Error in Binding TextChangeCommand : System.InvalidCastException Message=Object must implement IConvertible.

オープン
#387 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
mobile-dev

調査の方向性

XAML に示されている MaterialTextField TextChangeCommand バインディングと、ViewModel.cs のコマンド実装から始めます。ContentPage を開くときの Android の失敗を再現し、その後、コマンドパラメーターの変換を追跡します。ページが InvalidCastException なしで開き、コマンドが変更前と変更後のテキスト値を受け取れば完了です。

索引モデルが issue の本文から書いたものです。

説明

🐛 Bug Report

Hi!

When I try to Bind TextChangeCommand and ContentPage is openning the exception is thrown.

System.InvalidCastException Message=Object must implement IConvertible.

Expected behavior

Receive Old and New text typed on control in ViewModel Command method

Reproduction steps

XAML:

<material:MaterialTextField Placeholder="Transaction amount ?" LeadingIcon="dollar24" ErrorText="{Binding AmountErrorText}" HasError="{Binding AmountHasError}" BackgroundColor="Transparent" Grid.Row="3" Grid.Column="1" HelperText="{Binding AmountHelpText}" TextChangeCommand**="{Binding **AmountTextCahangeCommand ,Mode=TwoWay}" Text="{Binding Amount}" InputType="Numeric" />

ViewModel.cs
public ICommand AmountTextCahangeCommand { get { return new Command((a) => { _amountTextCahangeCommand(a); }); } }

Configuration

Version: 1.7.4

Platform:

  • 📱 iOS
  • [X ] 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms

Thank you!

主要言語
C#
スター
633
フォーク
150
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Baseflow/XF-Material-Library のほかの issue

Baseflow/XF-Material-Library の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。