diff --git a/UWPDDD/Dlls/AyxMVVM.dll b/UWPDDD/Dlls/AyxMVVM.dll index d9cfbdd..3f64f5d 100644 Binary files a/UWPDDD/Dlls/AyxMVVM.dll and b/UWPDDD/Dlls/AyxMVVM.dll differ diff --git a/UWPDDD/Domain/Model/ANote.cs b/UWPDDD/Domain/Model/ANote.cs index 69bebb6..63c387a 100644 --- a/UWPDDD/Domain/Model/ANote.cs +++ b/UWPDDD/Domain/Model/ANote.cs @@ -1,5 +1,7 @@  +using Domain.Repository; + namespace Domain.Model { public sealed class ANote @@ -10,5 +12,10 @@ public sealed class ANote public string Title { get; set; } public string Content { get; set; } public ACategory Category { get; set; } + + public void UpdateContent() + { + Content = Repositories.ANoteRepository.GetContent(ID); + } } } diff --git a/UWPDDD/Domain/Repository/Common/IANoteRepository.cs b/UWPDDD/Domain/Repository/Common/IANoteRepository.cs index 508bf15..60451b4 100644 --- a/UWPDDD/Domain/Repository/Common/IANoteRepository.cs +++ b/UWPDDD/Domain/Repository/Common/IANoteRepository.cs @@ -10,5 +10,6 @@ namespace Domain.Repository.Common public interface IANoteRepository:IRepository { ANote GetOne(int id); + string GetContent(int id); } } diff --git a/UWPDDD/Domain/Repository/Database/ANoteDataRepo.cs b/UWPDDD/Domain/Repository/Database/ANoteDataRepo.cs index 2a4f63a..a2b0792 100644 --- a/UWPDDD/Domain/Repository/Database/ANoteDataRepo.cs +++ b/UWPDDD/Domain/Repository/Database/ANoteDataRepo.cs @@ -20,6 +20,11 @@ public IEnumerable GetAll() throw new NotImplementedException(); } + public string GetContent(int id) + { + throw new NotImplementedException(); + } + public ANote GetOne(int id) { throw new NotImplementedException(); diff --git a/UWPDDD/Domain/Repository/Mars/ANoteMarsRepo.cs b/UWPDDD/Domain/Repository/Mars/ANoteMarsRepo.cs index a0d8e3a..a29d122 100644 --- a/UWPDDD/Domain/Repository/Mars/ANoteMarsRepo.cs +++ b/UWPDDD/Domain/Repository/Mars/ANoteMarsRepo.cs @@ -20,6 +20,11 @@ public IEnumerable GetAll() throw new NotImplementedException(); } + public string GetContent(int id) + { + throw new NotImplementedException(); + } + public ANote GetOne(int id) { throw new NotImplementedException(); diff --git a/UWPDDD/Domain/Repository/WebService/ANoteWebRepo.cs b/UWPDDD/Domain/Repository/WebService/ANoteWebRepo.cs index fb8e489..2df62cc 100644 --- a/UWPDDD/Domain/Repository/WebService/ANoteWebRepo.cs +++ b/UWPDDD/Domain/Repository/WebService/ANoteWebRepo.cs @@ -20,6 +20,11 @@ public IEnumerable GetAll() throw new NotImplementedException(); } + public string GetContent(int id) + { + throw new NotImplementedException(); + } + public ANote GetOne(int id) { throw new NotImplementedException(); diff --git a/UWPDDD/Infrastructure/Database/ANoteData.cs b/UWPDDD/Infrastructure/Database/ANoteData.cs index 7215947..1be1977 100644 --- a/UWPDDD/Infrastructure/Database/ANoteData.cs +++ b/UWPDDD/Infrastructure/Database/ANoteData.cs @@ -45,6 +45,19 @@ public IEnumerable> GetAll() } } + public string GetContentByID(int id) + { + const string GETCONTENT_SQL = @"SELECT Content FROM ANote WHERE ID=?"; + using (var statement = con.Prepare(GETCONTENT_SQL)) + { + var result = statement.Step(); + if (result == SQLiteResult.ROW) + return statement[0].ToString(); + else + return string.Empty; + } + } + public void Insert(string addDateTime, string editDateTime, string title, diff --git a/UWPDDD/UWPDDD/App.xaml b/UWPDDD/UWPDDD/App.xaml index 1fc9ec4..371bdca 100644 --- a/UWPDDD/UWPDDD/App.xaml +++ b/UWPDDD/UWPDDD/App.xaml @@ -2,7 +2,17 @@ x:Class="UWPDDD.App" 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:local="using:UWPDDD" + xmlns:vm="using:ViewModel" RequestedTheme="Light"> + + + + diff --git a/UWPDDD/UWPDDD/MainPage.xaml b/UWPDDD/UWPDDD/MainPage.xaml index 12ca1eb..7030feb 100644 --- a/UWPDDD/UWPDDD/MainPage.xaml +++ b/UWPDDD/UWPDDD/MainPage.xaml @@ -3,11 +3,65 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UWPDDD" + xmlns:vm="using:ViewModel" + x:Name="Main" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d"> + mc:Ignorable="d" + DataContext="{Binding NoteList, Source={StaticResource VMLocator}}"> - - + + + + + + + + + + + + +