Skip to content

Commit

Permalink
Incluida navegación de Channel a Feed.
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarNET committed Oct 12, 2015
1 parent 56cd898 commit 74a11d4
Show file tree
Hide file tree
Showing 40 changed files with 1,353 additions and 71 deletions.
15 changes: 6 additions & 9 deletions ComposedUI-PrismLibrary.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@ VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SogetiRSS", "SogetiRSS\SogetiRSS.csproj", "{103E42EB-4808-4065-815B-BA6006D4B348}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SogetiRSS.Shared", "SogetiRSS.Shared\SogetiRSS.Shared.shproj", "{6DD4198A-3F98-4AAC-86F5-5D816B9885FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SogetiRSS.Channels.ITBlog", "SogetiRSS.Channels.ITBlog\SogetiRSS.Channels.ITBlog.csproj", "{1BC1AE29-D704-411A-A442-9B25C0DB92C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SogetiRSS.Channels.Labs", "SogetiRSS.Channels.Labs\SogetiRSS.Channels.Labs.csproj", "{F1B66D97-6B8F-4E2C-BD72-45245721BE74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SogetiRSS.Channels.QANews", "SogetiRSS.Channels.QANews\SogetiRSS.Channels.QANews.csproj", "{75EFF8BC-B289-4A84-B37E-B8F57AD806C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SogetiRSS.Common", "SogetiRSS.Common\SogetiRSS.Common.csproj", "{78029918-5EE3-4F60-A8E7-F1988579A54F}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
SogetiRSS.Shared\SogetiRSS.Shared.projitems*{f1b66d97-6b8f-4e2c-bd72-45245721be74}*SharedItemsImports = 4
SogetiRSS.Shared\SogetiRSS.Shared.projitems*{103e42eb-4808-4065-815b-ba6006d4b348}*SharedItemsImports = 4
SogetiRSS.Shared\SogetiRSS.Shared.projitems*{6dd4198a-3f98-4aac-86f5-5d816b9885fa}*SharedItemsImports = 13
SogetiRSS.Shared\SogetiRSS.Shared.projitems*{1bc1ae29-d704-411a-a442-9b25c0db92c9}*SharedItemsImports = 4
SogetiRSS.Shared\SogetiRSS.Shared.projitems*{75eff8bc-b289-4a84-b37e-b8f57ad806c1}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand All @@ -42,6 +35,10 @@ Global
{75EFF8BC-B289-4A84-B37E-B8F57AD806C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75EFF8BC-B289-4A84-B37E-B8F57AD806C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75EFF8BC-B289-4A84-B37E-B8F57AD806C1}.Release|Any CPU.Build.0 = Release|Any CPU
{78029918-5EE3-4F60-A8E7-F1988579A54F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78029918-5EE3-4F60-A8E7-F1988579A54F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78029918-5EE3-4F60-A8E7-F1988579A54F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78029918-5EE3-4F60-A8E7-F1988579A54F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions SogetiRSS.Channels.ITBlog/ITBlogModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void Initialize()
{
this.regionManager.RegisterViewWithRegion(RegionNames.RSSChannels, typeof(ITBlogChannelView));

this.container.RegisterType<object, ITBlogFeedReaderView>("ITBlogFeedReaderView");
this.container.RegisterType<object, ITBlogFeedsView>("ITBlogFeedsView");
this.container.RegisterType<object, ITBlogFeedReaderView>(typeof(ITBlogFeedReaderView).Name);
this.container.RegisterType<object, ITBlogFeedsView>(typeof(ITBlogFeedsView).Name);
}

#endregion Methods
Expand Down
10 changes: 8 additions & 2 deletions SogetiRSS.Channels.ITBlog/SogetiRSS.Channels.ITBlog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down Expand Up @@ -100,10 +101,16 @@
<Compile Include="Views\ITBlogFeedsView.xaml.cs">
<DependentUpon>ITBlogFeedsView.xaml</DependentUpon>
</Compile>
<None Include="app.config" />
<None Include="packages.config" />
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\SogetiRSS.Common\SogetiRSS.Common.csproj">
<Project>{78029918-5ee3-4f60-a8e7-f1988579a54f}</Project>
<Name>SogetiRSS.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Views\ITBlogChannelView.xaml">
<SubType>Designer</SubType>
Expand All @@ -118,7 +125,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="..\SogetiRSS.Shared\SogetiRSS.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
51 changes: 49 additions & 2 deletions SogetiRSS.Channels.ITBlog/ViewModels/ITBlogChannelViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,59 @@
// ----------------------------------------------------------------------------
namespace SogetiRSS.ViewModels
{
using Prism.Mvvm;
using System;
using Microsoft.Practices.ServiceLocation;
using Prism.Regions;
using Views;

/// <summary>
/// Represents the view model for the ITBlogChannel view.
/// </summary>
internal class ITBlogChannelViewModel : BindableBase
internal class ITBlogChannelViewModel : BaseChannelViewModel
{
#region Constructors

/// <summary>
/// Initializes a new instance of the <see cref="ITBlogChannelViewModel"/> class.
/// </summary>
public ITBlogChannelViewModel()
: base("http://itblogsogeti.com/feed")
{
}

#endregion Constructors

#region Methods

/// <summary>
/// Executes the selected channel command.
/// </summary>
protected override void ExecuteSelectedChannelCommand()
{
GlobalCommands.ChannelSelectedCommand.Execute(ChannelNames.ITBlog);
}

/// <summary>
/// Called when a channel is selected.
/// </summary>
/// <param name="selectedChannelName">The name of the selected channel.</param>
protected override void OnSelectedChannel(string selectedChannelName)
{
if (selectedChannelName != ChannelNames.ITBlog)
{
this.IsChecked = false;
return;
}

var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
var navigationParameters = new NavigationParameters();
navigationParameters.Add("Feed", this.Feed);
regionManager.RequestNavigate(
RegionNames.RSSFeeds,
new Uri(typeof(ITBlogFeedsView).Name, UriKind.Relative),
navigationParameters);
}

#endregion Methods
}
}
4 changes: 1 addition & 3 deletions SogetiRSS.Channels.ITBlog/ViewModels/ITBlogFeedsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
// ----------------------------------------------------------------------------
namespace SogetiRSS.ViewModels
{
using Prism.Mvvm;

/// <summary>
/// Represents the view model for the ITBlogFeeds view.
/// </summary>
internal class ITBlogFeedsViewModel : BindableBase
internal class ITBlogFeedsViewModel : BaseFeedViewModel
{
}
}
18 changes: 14 additions & 4 deletions SogetiRSS.Channels.ITBlog/Views/ITBlogChannelView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
mc:Ignorable="d"
d:DesignHeight="100"
d:DesignWidth="200"
FontFamily="Trebuchet MS">
<Grid HorizontalAlignment="Left">
FontFamily="Trebuchet MS"
Margin="0,5,0,5">
<Grid HorizontalAlignment="Center">
<ToggleButton BorderBrush="#FFFFFFFF"
BorderThickness="4"
Cursor="Hand"
Foreground="#FFFFFFFF"
Height="100"
HorizontalContentAlignment="Stretch"
IsChecked="{Binding IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding IsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Stretch"
Width="200">
<Grid>
Expand All @@ -33,15 +36,22 @@
<TextBlock FontSize="16"
FontWeight="Bold"
Padding="5,2,0,0"
Text="IT Blog Sogeti" />
Text="{Binding Title, Mode=OneWay, NotifyOnSourceUpdated=True}"
TextWrapping="Wrap" />
<TextBlock FontSize="10"
Padding="5,2,0,0"
Text="Innovation Today in Business Technology" />
Text="{Binding Description, Mode=OneWay, NotifyOnSourceUpdated=True}"
TextWrapping="Wrap" />
</StackPanel>
<StackPanel Background="#FF53180E"
Grid.Column="0"
Grid.Row="1"
Orientation="Horizontal">
<TextBlock FontSize="10"
Foreground="#FFBAA39F"
Padding="5,0,0,2"
Text="{Binding LastUpdated, Mode=OneWay, NotifyOnSourceUpdated=True}"
VerticalAlignment="Bottom" />
</StackPanel>
</Grid>
</ToggleButton>
Expand Down
63 changes: 58 additions & 5 deletions SogetiRSS.Channels.ITBlog/Views/ITBlogFeedsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,62 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SogetiRSS.Views"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>

mc:Ignorable="d"
d:DesignHeight="100"
d:DesignWidth="350"
FontFamily="Trebuchet MS">
<Grid HorizontalAlignment="Center">
<ListBox BorderBrush="Transparent"
BorderThickness="0"
Foreground="#FFFFFFFF"
ItemsSource="{Binding FeedItems, Mode=OneWay, NotifyOnSourceUpdated=True}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Cursor="Hand"
HorizontalAlignment="Center"
Margin="0,5,0,5"
Orientation="Vertical"
Width="350">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Background="#FF939393"
Grid.Column="0"
Grid.Row="0"
Orientation="Vertical">
<TextBlock FontSize="16"
Foreground="#FFFFFFFF"
Padding="5,0,0,2"
Text="{Binding PublishDate, StringFormat={}{0:MMM}, Mode=OneWay, NotifyOnSourceUpdated=True}" />
<TextBlock FontSize="16"
Foreground="#FFFFFFFF"
Padding="5,2,0,0"
Text="{Binding PublishDate, StringFormat={}{0:dd/yyyy}, Mode=OneWay, NotifyOnSourceUpdated=True}" />
</StackPanel>
<StackPanel Background="#FFEF4527"
Grid.Column="1"
Grid.Row="0"
Orientation="Vertical">
<TextBlock FontSize="16"
FontWeight="Bold"
Padding="5,2,0,0"
Text="{Binding Title, Mode=OneWay, NotifyOnSourceUpdated=True}"
TextWrapping="Wrap" />
<TextBlock FontSize="10"
Padding="5,2,5,2"
Text="{Binding Summary, Mode=OneWay, NotifyOnSourceUpdated=True}"
TextWrapping="Wrap" />
</StackPanel>
</Grid>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>
</UserControl>
11 changes: 11 additions & 0 deletions SogetiRSS.Channels.ITBlog/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
4 changes: 2 additions & 2 deletions SogetiRSS.Channels.Labs/LabsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void Initialize()
{
this.regionManager.RegisterViewWithRegion(RegionNames.RSSChannels, typeof(LabsChannelView));

this.container.RegisterType<object, LabsFeedReaderView>("LabsFeedReaderView");
this.container.RegisterType<object, LabsFeedsView>("LabsFeedsView");
this.container.RegisterType<object, LabsFeedReaderView>(typeof(LabsFeedReaderView).Name);
this.container.RegisterType<object, LabsFeedsView>(typeof(LabsFeedsView).Name);
}

#endregion Methods
Expand Down
9 changes: 8 additions & 1 deletion SogetiRSS.Channels.Labs/SogetiRSS.Channels.Labs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down Expand Up @@ -103,6 +104,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand All @@ -119,7 +121,12 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="..\SogetiRSS.Shared\SogetiRSS.Shared.projitems" Label="Shared" />
<ItemGroup>
<ProjectReference Include="..\SogetiRSS.Common\SogetiRSS.Common.csproj">
<Project>{78029918-5ee3-4f60-a8e7-f1988579a54f}</Project>
<Name>SogetiRSS.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
52 changes: 50 additions & 2 deletions SogetiRSS.Channels.Labs/ViewModels/LabsChannelViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,60 @@
// ----------------------------------------------------------------------------
namespace SogetiRSS.ViewModels
{
using Prism.Mvvm;
using System;
using Microsoft.Practices.ServiceLocation;
using Prism.Regions;
using Views;

/// <summary>
/// Represents the view model for the LabsChannel view.
/// </summary>
internal class LabsChannelViewModel : BindableBase
internal class LabsChannelViewModel : BaseChannelViewModel
{
#region Constructors

/// <summary>
/// Initializes a new instance of the <see cref="LabsChannelViewModel" /> class.
/// </summary>
public LabsChannelViewModel()
: base("http://labs.sogeti.com/feed")
{
}

#endregion Constructors

#region Methods

/// <summary>
/// Executes the selected channel command.
/// </summary>
protected override void ExecuteSelectedChannelCommand()
{
GlobalCommands.ChannelSelectedCommand.Execute(ChannelNames.Labs);
}

/// <summary>
/// Called when a channel is selected.
/// </summary>
/// <param name="selectedChannelName">The name of the selected channel.</param>
protected override void OnSelectedChannel(string selectedChannelName)
{
if (selectedChannelName != ChannelNames.Labs)
{
this.IsChecked = false;
return;
}

var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
var navigationParameters = new NavigationParameters();

navigationParameters.Add("Feed", this.Feed);
regionManager.RequestNavigate(
RegionNames.RSSFeeds,
new Uri(typeof(LabsFeedsView).Name, UriKind.Relative),
navigationParameters);
}

#endregion Methods
}
}
Loading

0 comments on commit 74a11d4

Please sign in to comment.