Skip to content

Commit

Permalink
Started editing axaml page but kept running into `Request textDocumen…
Browse files Browse the repository at this point in the history
…t/completion failed. Error - System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')

   at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)`
Try on another machine.
  • Loading branch information
TcPirate1 committed May 10, 2024
1 parent 2a1e6e0 commit e47b9ff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion ViewModels/AddPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@
using System.Text;
using System.Threading.Tasks;
using AvaloniaGUI.Models;
using ReactiveUI;

namespace AvaloniaGUI.ViewModels
{
public class AddPageViewModel
public class AddPageViewModel : ReactiveObject
{
// Create instance of the Card class in here. Use RaiseAndSetIfChanged to detect change and bind to the views.
private Card _card;

public Card Card
{
get => _card;
set => this.RaiseAndSetIfChanged(ref _card, value);
}

public AddPageViewModel()
{
Card = new Card();
}
}
}
4 changes: 2 additions & 2 deletions Views/AddPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<StackPanel Orientation="Vertical">

<!-- Code -->
<TextBlock Text="Card Code" FontSize="12" Margin="0,10" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding Card.Code}" FontSize="12" Margin="0,10" HorizontalAlignment="Center"/>
<TextBox x:Name="CardCodeTxtBox" Margin="0,0,0,10" Width="200"/>

<!-- Name -->
<TextBlock Text="Card Name" FontSize="12" Margin="0,10" HorizontalAlignment="Center"/>
<TextBlock Text="{Binding Card.Name}" FontSize="12" Margin="0,10" HorizontalAlignment="Center"/>
<TextBox x:Name="CardNameTxtBox" Margin="0,0,0,10" Width="200"/>

<!-- Type -->
Expand Down

0 comments on commit e47b9ff

Please sign in to comment.