Skip to content

Commit

Permalink
Fix passing board name to save file and import board
Browse files Browse the repository at this point in the history
  • Loading branch information
MRmlik12 committed May 23, 2024
1 parent ee95ac7 commit 1915707
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NoteSHR/ViewModels/BoardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public BoardViewModel()

if (folderPicker.Count == 0) return;

await BoardExporter.ExportToFile(Notes.ToList(), Guid.NewGuid().ToString(), folderPicker[0].Path.AbsolutePath);
await BoardExporter.ExportToFile(Notes.ToList(), Name, folderPicker[0].Path.AbsolutePath);
});

ImportBoardCommand = ReactiveCommand.CreateFromTask(async (RoutedEventArgs args) =>
Expand Down
2 changes: 1 addition & 1 deletion src/NoteSHR/Views/BoardToolbar.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


<DockPanel Background="Transparent">
<TextBox Foreground="Black" Background="Transparent" FontSize="24" Width="600" x:Name="BoardNameTextBlock" />
<TextBox Foreground="Black" Background="Transparent" FontSize="24" Width="600" x:Name="BoardNameTextBox" />
<Button DockPanel.Dock="Right" x:Name="ExportBoardButton" Click="ExportBoardButton_OnClick"
Background="Transparent" Foreground="GhostWhite">
<Svg Path="/Assets/Icons/save-outline.svg" Width="32" Height="32" />
Expand Down
11 changes: 11 additions & 0 deletions src/NoteSHR/Views/BoardToolbar.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ public BoardToolbar()
InitializeComponent();
}

protected override void OnLoaded(RoutedEventArgs e)
{
var boardNameTextBox = this.FindControl<TextBox>("BoardNameTextBox");
boardNameTextBox?.Bind(TextBox.TextProperty, new Binding
{
Source = this,
Path = "BoardName",
Mode = BindingMode.TwoWay
});
}

public string BoardName
{
get => GetValue(BoardNameProperty);
Expand Down

0 comments on commit 1915707

Please sign in to comment.