I downloaded the sqlite-net-pcl
nuget package from visual studio, but in my .XAML file I am getting the following exception:
Unable to load DLL 'e_sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
specifically in the line
<vm:NotesVM x:Key="vm"/>
the complete .XAML is:
<Window x:Class="EverNoteApp.View.NotesWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:EverNoteApp.View"
xmlns:vm ="clr-namespace:EverNoteApp.ViewModel"
mc:Ignorable="d"
Title="NotesWindow" Height="450" Width="800">
<!--Add reference to View Model-->
<Window.Resources>
<vm:NotesVM x:Key="vm"/>
</Window.Resources>
<Grid>
</Grid>
</Window>
The code for the NotesVM
under the EverNoteApp.ViewModel
namespace:
using EverNoteApp.Model;
using EverNoteApp.ViewModel.Commands;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace EverNoteApp.ViewModel
{
public class NotesVM
{
private NoteBook m_selectedNotebook;
public NotesVM()
{
NewNoteBookCommand = new NewNoteBookCommand(this);
NewNoteCommand = new NewNoteCommand(this);
NoteBooks = new ObservableCollection<NoteBook>();
Notes = new ObservableCollection<Note>();
}
public NewNoteBookCommand NewNoteBookCommand { get; set; }
public NewNoteCommand NewNoteCommand { get; set; }
/// <summary>
/// Will display notebooks in UI, in list view
/// </summary>
public ObservableCollection<NoteBook> NoteBooks { get; set; }
/// <summary>
/// Notes will be stored in this ObservableCollection every time the
/// SelectedNotebook changes
/// </summary>
public ObservableCollection<Note> Notes { get; set; }
public NoteBook SelectedNotebook
{
get { return m_selectedNotebook; }
set
{
m_selectedNotebook = value;
//TODO: Get notes
}
}
/// <summary>
/// Create a new Note book and add it to the
/// data base
/// </summary>
public void CreateNoteBook()
{
// Create new note book
NoteBook newNoteBook = new NoteBook()
{
Name = "New notebook",
};
// Insert Note book in data base
DataBaseHelper.Insert<NoteBook>(newNoteBook);
}
/// <summary>
/// Create a new Note and add it to the
/// data base
/// </summary>
/// <param name="noteBookId"> The note book unique id </param>
public void CreateNote(int noteBookId)
{
// Create new note
Note newNote = new Note()
{
NotebookId = noteBookId,
CreatedTime = DateTime.Now,
UpdatedTime = DateTime.Now,
Title = "New note"
};
// Insert Note in data base
DataBaseHelper.Insert<Note>(newNote);
}
}
}
I saw some similar posts but they were from many years ago, so I didint try to spend much time to read over the thread.
I am using .NET Framework 4.7.2
User contributions licensed under CC BY-SA 3.0