<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>shashankyerramilli</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/shashankyerramilli/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/shashankyerramilli/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:10:51 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Check if a file exists in Windows Phone 8 and WinRT without exception</title>
      <link>https://docs.microsoft.com/archive/blogs/shashankyerramilli/check-if-a-file-exists-in-windows-phone-8-and-winrt-without-exception</link>
      <pubDate>Mon, 17 Feb 2014 04:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Shashank Yerramilli]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/shashankyerramilli/2014/02/17/check-if-a-file-exists-in-windows-phone-8-and-winrt-without-exception/</guid>
      <description><![CDATA[Hi Friends,
I recently came across a requirement to check if a file is present in the local storage...]]></description>
      <content:encoded><![CDATA[<p>Hi Friends,</p>
<p>I recently came across a requirement to check if a file is present in the local storage of WinRT application as well as Windows phone 8 application.</p>
<p>I did not find any suitable methods available in the LocalFolder class such as &nbsp;LocalFolder.FileExists(). &nbsp;I searched over the internet and what most people suggested are as below.</p>
<ol>
<li>Handle Exception Method</li>
<li>Looping over all file names to check if the name exists.</li>
</ol>
<div><span style="font-size: medium;"><strong>1. Handling exception method:</strong></span></div>
<div>
<pre class="scroll"><code class="csharp"> public async Task&lt;bool&gt; isFilePresent(string fileName)<br /> {<br /> bool fileExists = true;<br /> Stream fileStream = null;<br /> StorageFile file = null;<br /> <br /> try<br /> {<br /> file = await ApplicationData.Current.LocalFolder.GetFileAsync(fileName);<br /> fileStream = await file.OpenStreamForReadAsync();<br /> fileStream.Dispose();<br /> }<br /> catch (FileNotFoundException)<br /> {<br /> // If the file dosn't exits it throws an exception, make fileExists false in this case <br /> fileExists = false;<br /> }<br /> finally<br /> {<br /> if (fileStream != null)<br /> {<br /> fileStream.Dispose();<br /> }<br /> }<br /> <br /> return fileExists;<br /> }</code></pre>
</div>
<p><span style="font-size: medium;"><strong>2. Looping over all file names to check if the name exists</strong></span></p>
<pre class="scroll"><code class="csharp"><br /> public async Task&lt;bool&gt; isFilePresent(string fileName)<br /> { <br /> bool fileExists = false;<br /> var allfiles = await ApplicationData.Current.LocalFolder.GetFilesAsync();<br /> foreach (var storageFile in allfiles)<br /> {<br /> if (storageFile.Name == fileName)<br /> {<br /> fileExists = true;<br /> }<br /> }<br /> return fileExists;<br /> }</code></pre>
<p>Both seem to be costly operations and handling exception is not the right way.</p>
<p>&nbsp;</p>
<p><span style="font-size: medium;"><strong>Solution :</strong></span></p>
<p>The Solution is a little different from WinRT to WP8.</p>
<p><span style="font-size: medium;"><strong>WP8 Solution</strong></span></p>
<pre class="scroll"><code class="cplusplus">public async Task&lt;bool&gt; isFilePresent(string fileName)<br /> {<br /> return System.IO.File.Exists(string.Format(@"{0}\{1}", ApplicationData.Current.LocalFolder.Path, fileName);<br /> }</code></pre>
<p>&nbsp;</p>
<p><span style="font-size: medium;"><strong>WinRT Solution :</strong></span></p>
<pre class="scroll"><code class="csharp">public async Task&lt;bool&gt; isFilePresent(string fileName)<br /> {<br /> var item = await ApplicationData.Current.LocalFolder.TryGetItemAsync(fileName);<br /> return item != null;<br /> }</code></pre>
<p>&nbsp;</p>
<p>Feel free to comment and Rate the articles.&nbsp;</p>
<p>Thanks Friends!!!!!!!!!!&nbsp;</p>
<p>Happy Coding!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Import database into Azure using Azure Power Shell</title>
      <link>https://docs.microsoft.com/archive/blogs/shashankyerramilli/import-database-into-azure-using-azure-power-shell</link>
      <pubDate>Fri, 14 Feb 2014 23:34:00 GMT</pubDate>
      <dc:creator><![CDATA[Shashank Yerramilli]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/shashankyerramilli/2014/02/14/import-database-into-azure-using-azure-power-shell/</guid>
      <description><![CDATA[Hi All
The below powrshell script gives &nbsp;you an idea on how to import a Azure Database backup...]]></description>
      <content:encoded><![CDATA[<p>Hi All</p>
<p>The below powrshell script gives &nbsp;you an idea on how to import a Azure Database backup bacpac file into your azure subscription.</p>
<p>The comments are inline with the actions performed.</p>
<p>&nbsp;</p>
<pre class="scroll"><code class="cplusplus"><br /> $DatabaseName = "MyDatabaseName"<br /> Write-Host "You have to download the publish settings file inorder to continue with the deployment"<br /> Write-Host "You will be redirected to the azure site to download the file. the download will start automatically"<br /> $name = Read-Host 'Press Enter to Continue'<br /> # Downloads the publish settings file from your azure subscription<br /> Get-AzurePublishSettingsFile<br /> $name = Read-Host 'Press Enter to Continue'<br /> Write-Host "Browse the .publishsetttings file you have just downloaded"<br /> $name = Read-Host 'Press Enter to Continue'<br /> # Use file dialog to browse the publish settings file. I am pointing it to Downloads folder of user<br /> $dialog = New-Object system.windows.forms.openfiledialog<br /> $dialog.InitialDirectory = $home + "\Downloads"<br /> $dialog.DefaultExt = '.publishsettings'<br /> $dialog.Filter = 'Publish Settings|*.publishsettings|All Files|*.*'<br /> $dialog.Multiselect = $false<br /> $dialog.Title = "Select a Azure Subscriptions Publishsettings file"<br /> $rc = $dialog.ShowDialog()<br /> if ($rc -eq [System.Windows.Forms.DialogResult]::OK)<br /> {<br /> $dialog = $dialog.FileName<br /> }<br /> #note : overriding the $dialog with file name<br /> #imports the publish settings file<br /> # the publish settings file has the certificate which lets you access the azure subscription .<br /> Import-AzurePublishSettingsFile $dialog<br /> # Setting the container name. Creates a container in which the database backup file will be uploaded<br /> # The database backup is uploaded to blob container and then imported to the database.<br /> # Te database back up file/container will be removed after the import<br /> $StorageAccountName = Read-Host 'Enter the Storage Account Name' <br /> # fetching the Key from the storage account. this is needed to set the context.<br /> $storageAccountKey = Get-AzureStorageKey $StorageAccountName | %{ $_.Primary }<br /> #create a storage context <br /> $StorageContext = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $storageAccountKey<br /> # Creates the container in your storage account.<br /> # and uploads the backup file to this container<br /> $DbBackupContainerName = "databasebackupcontainer"<br /> # The database backup file name. This is the bacpac file generated when exporting the database.<br /> $DbBackupFileName = "MyDatabaseBackup.zip"<br /> # Getting the current folder from script execution path<br /> $scriptpath = $MyInvocation.MyCommand.Path<br /> $dir = Split-Path $scriptpath<br /> #Appending the subfolder name data to the current script path. All data is should be in data folder of current script.<br /> # the database backup file is put at in the data sub folder.<br /> $fqName = $dir + "\Data\" + $DbBackupFileName<br /> #create the container to upload the data<br /> New-AzureStorageContainer $DbBackupContainerName -Permission Off -Context $StorageContext<br /> #upload the current file to the blob<br /> Set-AzureStorageBlobContent -Blob $DbBackupFileName -Container $DbBackupContainerName -File $fqName -Context $StorageContext -Force<br /> Write-Host "Enter the Database Server credentials in the popup window"<br /> $name = Read-Host 'Press Enter to Continue'<br /> # Prompt user to enter credentials for the database server.<br /> # The password must follow standard password guidelines<br /> # It must be a mix of alphabets, numbers and special characters. The error check has not been handled in the script here incase of password not matching standards<br /> $credential = Get-Credential<br /> # Create a new Server to upload the database. If you have an exisiting server skip creating new server and use servername directly in the next step.<br /> $server = New-AzureSqlDatabaseServer -Location "East US" -AdministratorLogin $credential.UserName -AdministratorLoginPassword $credential.GetNetworkCredential().Password<br /> # creating fully qualified servername<br /> $fqServerName = $server.ServerName + ".database.windows.net"<br /> # to manage the database we have to add the current ip address to the list of allowed ip addresses to the list.<br /> # using the .Net web client object to get the ip address ad adding it as firewall rule<br /> $wc=New-Object net.webclient<br /> $ip = $wc.downloadstring("https://checkip.dyndns.com") -replace "[^\d\.]" <br /> # fetchng todays date<br /> $todaysdatetime = Get-Date<br /> # creating a firewall rule name with a timestamp of todays date.<br /> $firewallRulename = "ClientIpAddress" + $todaysdatetime.Year +"-" + $todaysdatetime.Month +"-" + $todaysdatetime.Day +"-" + $todaysdatetime.Hour +"-" + $todaysdatetime.Minute +"-"+ $todaysdatetime.Second +"-" + $todaysdatetime.Millisecond <br /> #add the firewall rule<br /> $server | New-AzureSqlDatabaseServerFirewallRule -RuleName $firewallRulename -StartIPAddress $ip -EndIPAddress $ip <br /> # create a new datavase. which is a web edition/ you can also create database with business edition.<br /> $database = New-AzureSqlDatabase -ServerName $server.ServerName -DatabaseName $DatabaseName -Edition "Web" -MaxSizeGB 1 -Collation "SQL_Latin1_General_CP1_CI_AS"<br /> # making the server to allow azure services<br /> $server | New-AzureSqlDatabaseServerFirewallRule -AllowAllAzureServices <br /> #setting the sql context<br /> $SqlCtx = New-AzureSqlDatabaseServerContext -ServerName $server.ServerName -Credential $credential<br /> #get the container nto variable<br /> $Container = Get-AzureStorageContainer -Name $DbBackupContainerName -Context $StorageContext<br /> #import the bacpac file uploaded into the databse name mentioned.<br /> $importRequest = Start-AzureSqlDatabaseImport -SqlConnectionContext $SqlCtx -StorageContainer $Container -DatabaseName $DatabaseName -BlobName $DbBackupFileName<br /> #delete the container with the database backup bacpac file after import.<br /> Remove-AzureStorageContainer -Name $DbBackupContainerName -Context $StorageContext -Force -Confirm </code></pre>]]></content:encoded>
    </item>
    <item>
      <title>Upload files to Blob Storage using Azure Power Shell</title>
      <link>https://docs.microsoft.com/archive/blogs/shashankyerramilli/upload-files-to-blob-storage-using-azure-power-shell</link>
      <pubDate>Fri, 14 Feb 2014 21:02:51 GMT</pubDate>
      <dc:creator><![CDATA[Shashank Yerramilli]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/shashankyerramilli/2014/02/14/upload-files-to-blob-storage-using-azure-power-shell/</guid>
      <description><![CDATA[Hi all,
Often when working with azure you would need to upload content to your storage.
The below...]]></description>
      <content:encoded><![CDATA[<p>Hi all,</p>
<p>Often when working with azure you would need to upload content to your storage.</p>
<p>The below script uploads data to your storage container. the comments inline describe the every step</p>
<pre class="scroll"><code class="cplusplus"># The storage account to which you want to upload data to<br /> $StorageAccountName = Read-Host 'Enter the Storage Account Name you created' <br /> Write-Host "You have to download the publish settings file inorder to continue with the deployment"<br /> Write-Host "You will be redirected to the azure site to download the file. the download will start automatically"<br /> $name = Read-Host 'Press Enter to Continue'<br /> # Downloads the publish settings file from your azure subscription<br /> Get-AzurePublishSettingsFile<br /> $name = Read-Host 'Pres Enter to Continue'<br /> # Usee file dialog to browse the publish settings file. I am pointing it to Downloads folder of user<br /> Write-Host "Browse the .publishsetttings file you have just downloaded"<br /> $name = Read-Host 'Pres Enter to Continue'<br /> $dialog = New-Object system.windows.forms.openfiledialog<br /> $dialog.InitialDirectory = $home + "\Downloads"<br /> $dialog.DefaultExt = '.publishsettings'<br /> $dialog.Filter = 'Publish Settings|*.publishsettings|All Files|*.*'<br /> $dialog.Multiselect = $false<br /> $dialog.Title = "Select a Azure Subscriptions Publishsettings file"<br /> $rc = $dialog.ShowDialog()<br /> if ($rc -eq [System.Windows.Forms.DialogResult]::OK)<br /> {<br /> $dialog = $dialog.FileName<br /> }<br /> #note I am overriding the $dialog with file name<br /> #imports the publish settings file<br /> # the publish settings file has the certificate which lets you access the azure subscription .<br /> Import-AzurePublishSettingsFile $dialog<br /> <br /> Write-Host "Uploading to Storage Account"<br /> $name = Read-Host 'Pres Enter to Continue'<br /> # Setting the container name. Creates a container in which the files will be uploaded<br /> $ContainerName = "AzureFiles"<br /> # fetching the Key from the storage account. this is needed to set the context.<br /> $storageAccountKey = Get-AzureStorageKey $storageAccountName | %{ $_.Primary }<br /> Write-Host "Files will be uploaded to the storage account/Container"<br /> #create a storage context <br /> $context = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $storageAccountKey<br /> #creates the container in your storage account. I am not if container already exists.<br /> # you can check by get-storagecontainer and check for errors.<br /> New-AzureStorageContainer $ContainerName -Permission Container -Context $context<br /> # Getting the current folder from script execution path<br /> $scriptpath = $MyInvocation.MyCommand.Path<br /> $dir = Split-Path $scriptpath <br /> #Appending the subfolder name data to yhe current script path. All data is should be in data folder of current script<br /> $dir = $dir + "\Data"<br /> <br /> # $_.mode -match "-a---" scans the data directory and ony fetches the files. It filters out all directories<br /> $files = Get-ChildItem $dir -force| Where-Object {$_.mode -match "-a---"}<br /> <br /> # iterate through all the files and start uploading data<br /> foreach ($file in $files)<br /> {<br /> #fq name represents fully qualified name<br /> $fqName = $dir + "\" + $file.Name<br /> #upload the current file to the blob<br /> Set-AzureStorageBlobContent -Blob $file.Name -Container $ContainerName -File $fqName -Context $context -Force<br /> }<br /> </code></pre>]]></content:encoded>
    </item>
    <item>
      <title>Implementing a Custom Semantic Zoom Container</title>
      <link>https://docs.microsoft.com/archive/blogs/shashankyerramilli/implementing-a-custom-semantic-zoom-container</link>
      <pubDate>Fri, 14 Feb 2014 18:21:48 GMT</pubDate>
      <dc:creator><![CDATA[Shashank Yerramilli]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/shashankyerramilli/2014/02/14/implementing-a-custom-semantic-zoom-container/</guid>
      <description><![CDATA[Implementing a Custom Semantic Zoom Container
&nbsp;Semantic Zoom:
Windows 8 provides a secondary...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: large;"><strong>Implementing a Custom Semantic Zoom Container</strong></span></p>
<p><span style="font-size: medium;"><strong>&nbsp;Semantic Zoom:</strong></span></p>
<p>Windows 8 provides a secondary view to view the summary and scroll to the respective section through a container called Semantic zoom. This is functionality is also available at OS level as well as Application level.</p>
<p>There are two Different views:</p>
<ol>
<li>Zoomed In View (Details View )(The Default View/ctrl + (scroll mouse up) / pinch out)</li>
<li>Zoomed Out View(Summary View) &nbsp;(The Summary View/ctrl + (scroll mouse down)/ pinch in)</li>
</ol>
<p><span style="font-size: medium;"><strong>Default Semantic Zoom Implementation:</strong></span></p>
<p>&nbsp;The default implementation of semantic zoom is done by implementing the semantic zoom control which has two children the zoomed out view and the zoomed in view. The application switches between the two views with only one of them visible at one point of time.</p>
<p>&nbsp;</p>
<pre class="scroll"><code class="cplusplus"> &lt;SemanticZoom <br /> VerticalAlignment="Stretch" <br /> VerticalContentAlignment="Stretch" &gt;<br /> <br /> &lt;SemanticZoom.ZoomedOutView&gt;<br /> &lt;!&mdash;Your zoomed out view Content inside GridView/ListView--&gt;<br /> &lt;/SemanticZoom.ZoomedOutView&gt;<br /> <br /> &lt;SemanticZoom.ZoomedInView&gt;<br /> &lt;!&mdash;Your zoomed in view Content inside GridView/ListView --&gt; <br /> &lt;/SemanticZoom.ZoomedInView&gt;<br /> &lt;/SemanticZoom&gt;<br /></code><strong><br /></strong></pre>
<pre class="scroll"><span style="font-size: medium;"><strong>Limitation:</strong></span></pre>
<p>The default implementation of Semantic zoom only accepts a GridView / ListView as its child elements. i.e. All the content in your ZoomedInView or ZoomedOutView should be wrapped inside a GridView / ListView.</p>
<p><span style="font-size: medium;"><strong>Problem:</strong></span></p>
<p>What is the solution if you have to implement a semantic zoom on views with unstructured data or Views that are already implemented using other content controls/panels other than GridView / ListView.</p>
<p>&nbsp;</p>
<p><span style="font-size: medium;"><strong>Solution:</strong></span></p>
<p>The ZoomedInView / ZoomedOutView in a semantic zoom control only accept the children that implement ISemanticZoomInformation interface. The GridView / ListView implement the ISemanticZoomInformation as a part of their implementation. In order to get our panel/container working in a ZoomedInView / ZoomedOutView we can implement a UserControl that inherits from the <span style="font-size: large;">IsemanticZoomInformation</span> interface.</p>
<p>&nbsp;Below is the code snippet showing implementation of a grid implementing IsemanticZoomInformation.</p>
<p><span style="font-size: medium;">SemanticZoomGrid.xaml</span></p>
<p>&nbsp;</p>
<pre class="scroll"><code class="cplusplus">&lt;Grid<br /> xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"<br /> xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"<br /> xmlns:d="https://schemas.microsoft.com/expression/blend/2008"<br /> xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"<br /> mc:Ignorable="d"<br /> d:DesignHeight="300"<br /> d:DesignWidth="400"&gt;<br /> <br /> &lt;/Grid&gt;<br /> </code></pre>
<p><span style="font-size: medium;">SemanticZoomGrid.xaml.cs</span></p>
<p>&nbsp;</p>
<pre class="scroll"><code class="csharp">public sealed partial class SemanticZoomGrid : Grid, ISemanticZoomInformation<br /> {<br /> public SemanticZoomGrid()<br /> {<br /> this.InitializeComponent();<br /> }<br /> <br /> public void CompleteViewChange()<br /> {<br /> }<br /> <br /> public void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)<br /> {<br /> }<br /> <br /> public void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)<br /> {<br /> }<br /> <br /> public void InitializeViewChange()<br /> {<br /> }<br /> <br /> public bool IsActiveView<br /> {<br /> get;<br /> set;<br /> }<br /> <br /> public bool IsZoomedInView<br /> {<br /> get;<br /> set;<br /> }<br /> <br /> public void MakeVisible(SemanticZoomLocation item)<br /> {<br /> }<br /> <br /> public SemanticZoom SemanticZoomOwner<br /> {<br /> get;<br /> set;<br /> }<br /> <br /> public void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)<br /> {<br /> }<br /> <br /> public void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)<br /> {<br /> }<br /> }<br /> </code></pre>
<p>&nbsp;</p>
<p>The UserControl implemented from the<strong><span style="font-size: small;"> Grid</span></strong> and the <strong>IsemanticZoomInformation</strong> can now be used in the ZoomedInView and the ZoomedOutView of the semanticzoom control.</p>
<p>&nbsp;</p>
<p><strong>Note</strong>: if you have a view that goes beyond the screen implement a <strong>scroll viewer</strong> inside the <strong>SemanticZoomGrid</strong> user control for the content to scroll properly.</p>
<p>&nbsp;</p>
<p>Below is the code snippet implementing the <span style="font-size: medium;">usercontrol</span> in a view</p>
<p>&nbsp;</p>
<pre class="scroll"><code class="cplusplus"> &lt;SemanticZoom ViewChangeStarted="SemanticZoom_ViewChangeStarted"&gt;<br /> &lt;SemanticZoom.ZoomedOutView&gt;<br /> <br /> &lt;GridView x:Name="groupGridView" <br /> Padding="0,0,10,10"<br /> Margin="116,25,50,0" <br /> Grid.Row="1" <br /> ItemTemplate="{StaticResource ListItemTemplate}" <br /> ItemsSource="{Binding}"&gt;<br /> <br /> &lt;GridView.ItemsPanel&gt;<br /> &lt;ItemsPanelTemplate&gt;<br /> &lt;VariableSizedWrapGrid Orientation="Vertical" Mar-gin="0,0,80,0"/&gt;<br /> &lt;/ItemsPanelTemplate&gt;<br /> &lt;/GridView.ItemsPanel&gt;<br /> &lt;/GridView&gt;<br /> &lt;/SemanticZoom.ZoomedOutView&gt;<br /> &lt;SemanticZoom.ZoomedInView&gt;<br /> &lt;userControl:SemanticGrid x:Name="MyCustomSemanticPanel"&gt;<br /> &lt;ScrollViewer ZoomMode="Disabled" x:Name="scroller"<br /> HorizontalScrollBarVisibility="Auto" <br /> VerticalScrollBarVisibility="Disabled"<br /> VerticalScrollMode="Disabled"&gt;<br /> &lt;Grid&gt;<br /> &lt;Grid.RowDefinitions&gt;<br /> &lt;RowDefinition Height="*" /&gt;<br /> &lt;!--&lt;RowDefinition Height="*"/&gt;--&gt;<br /> &lt;/Grid.RowDefinitions&gt;<br /> &lt;Grid.ColumnDefinitions&gt;<br /> &lt;ColumnDefinition Width="Auto" /&gt;<br /> &lt;ColumnDefinition Width="Auto"/&gt;<br /> &lt;ColumnDefinition Width="Auto"/&gt;<br /> &lt;ColumnDefinition Width="Auto"/&gt;<br /> &lt;/Grid.ColumnDefinitions&gt;<br /> &lt;StackPanel x:Name="A" Grid.Row="0" Grid.Column="0"&gt;<br /> <br /> &lt;GridView Name="groupGridViewA" <br /> Padding="0,0,10,10"<br /> Margin="116,25,50,0" <br /> ItemTemplate="{StaticResource ListItemTemplate}" <br /> ItemsSource="{Binding}"<br /> Height="800" &gt;<br /> <br /> &lt;GridView.ItemsPanel&gt;<br /> &lt;ItemsPanelTemplate&gt;<br /> &lt;VariableSizedWrapGrid Orientation="Vertical" Margin="0,0,10,0"/&gt;<br /> &lt;/ItemsPanelTemplate&gt;<br /> &lt;/GridView.ItemsPanel&gt;<br /> &lt;/GridView&gt;<br /> &lt;/StackPanel&gt;<br /> &lt;StackPanel x:Name="B" Grid.Row="0" Grid.Column="1"&gt;<br /> &lt;GridView Name="groupGridViewB" <br /> Padding="0,0,10,10"<br /> Margin="116,25,50,0" <br /> ItemTemplate="{StaticResource ListItemTemplate}" <br /> ItemsSource="{Binding}"<br /> Height="800" &gt;<br /> <br /> &lt;GridView.ItemsPanel&gt;<br /> &lt;ItemsPanelTemplate&gt;<br /> &lt;VariableSizedWrapGrid Orientation="Vertical" Margin="0,0,80,0"/&gt;<br /> &lt;/ItemsPanelTemplate&gt;<br /> &lt;/GridView.ItemsPanel&gt;<br /> &lt;/GridView&gt;<br /> &lt;/StackPanel&gt;<br /> &lt;StackPanel x:Name="C" Grid.Row="0" Grid.Column="2"&gt;<br /> &lt;GridView Name="groupGridViewC" <br /> Padding="0,0,10,10"<br /> Margin="116,25,50,0" <br /> ItemTemplate="{StaticResource ListItemTemplate}" <br /> ItemsSource="{Binding}"<br /> Height="800" &gt;<br /> <br /> &lt;GridView.ItemsPanel&gt;<br /> &lt;ItemsPanelTemplate&gt;<br /> &lt;VariableSizedWrapGrid Orientation="Vertical" Margin="0,0,80,0"/&gt;<br /> &lt;/ItemsPanelTemplate&gt;<br /> &lt;/GridView.ItemsPanel&gt;<br /> &lt;/GridView&gt;<br /> &lt;/StackPanel&gt;<br /> &lt;StackPanel x:Name="D" Grid.Row="0" Grid.Column="3"&gt;<br /> &lt;GridView Name="groupGridViewD" <br /> Padding="0,0,10,10"<br /> Margin="116,25,50,0" <br /> ItemTemplate="{StaticResource ListItemTemplate}" <br /> ItemsSource="{Binding}"<br /> Height="800" &gt;<br /> <br /> &lt;GridView.ItemsPanel&gt;<br /> &lt;ItemsPanelTemplate&gt;<br /> &lt;VariableSizedWrapGrid Orientation="Vertical" Margin="0,0,80,0"/&gt;<br /> &lt;/ItemsPanelTemplate&gt;<br /> &lt;/GridView.ItemsPanel&gt;<br /> &lt;/GridView&gt;<br /> &lt;/StackPanel&gt;<br /> &lt;/Grid&gt;<br /> &lt;/ScrollViewer&gt;<br /> &lt;/userControl:SemanticGrid&gt;<br /> &lt;/SemanticZoom.ZoomedInView&gt;<br /> &lt;/SemanticZoom&gt;<br /> </code></pre>
<p><span style="font-size: medium;"><strong>Zooming In on to the Correct View:</strong></span></p>
<p>The Main purpose of the SemanticZoom is to help user reach his data quickly. On click of the summary item the ZomedInView must scroll to the location where user would be interested to see the details. This can be achieved by implementing ViewChangeStarted event of the semanticzoom control.</p>
<p>&nbsp;</p>
<p>Code Snippet to implement the zoomin&nbsp; feature:</p>
<pre class="scroll"><code class="cplusplus"> private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomView-ChangedEventArgs e)<br /> {<br /> ScrollViewer fe = (ScrollViewer)MyCustomSemanticPanel.FindName("scroller");<br /> fe.ScrollToHorizontalOffset(0);<br /> if (e.IsSourceZoomedInView)<br /> {<br /> return;<br /> }<br /> else<br /> {<br /> Item i = e.SourceItem.Item as Item;<br /> if (i.Items == "A")<br /> {<br /> StackPanel sp = (StackPanel)MyCustomSemanticPanel.FindName("A");<br /> fe.ScrollToHorizontalOffset(sp.TransformToVisual(fe).TransformBounds(new Rect(0, 0, 1, 1)).Left);<br /> }<br /> else if (i.Items == "B")<br /> {<br /> StackPanel sp = (StackPanel)MyCustomSemanticPanel.FindName("B");<br /> fe.ScrollToHorizontalOffset(sp.TransformToVisual(fe).TransformBounds(new Rect(0, 0, 1, 1)).Left);<br /> }<br /> else if (i.Items == "C")<br /> {<br /> StackPanel sp = (StackPanel)MyCustomSemanticPanel.FindName("C");<br /> fe.ScrollToHorizontalOffset(sp.TransformToVisual(fe).TransformBounds(new Rect(0, 0, 1, 1)).Left);<br /> }<br /> else if (i.Items == "D")<br /> {<br /> StackPanel sp = (StackPanel)MyCustomSemanticPanel.FindName("D");<br /> fe.ScrollToHorizontalOffset(sp.TransformToVisual(fe).TransformBounds(new Rect(0, 0, 1, 1)).Left);<br /> }<br /> }<br /> <br /> }<br /> </code></pre>
<p>attatched is the SemanticZoom example</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/50/04/49/CustomSemanticZoom.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-50-04-49/CustomSemanticZoom.zip">CustomSemanticZoom.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>