XAMLCast – Episódio 18 – Sterling DB, SilverMotion, Windows Phone 7 e mais 31/7/10
Fala pessoal!

Depois de duas semanas sem gravar por causa de dificuldade em sincronizar nossas agendas, acabamos decidindo gravar esse episódio sem o Kono para não deixar vocês, nossos ouvintes, mais uma semana sem o XAMLCast. Mas não se preocupem pois no próximo episódio estaremos todos de volta.
Nesta semana falamos de Sterling DB, SilverMotion, Windows Phone 7, Silverlight para Symbian e Xte Profiler. Ouça!
- Silvelight para Symbian – http://www.silverlight.net/getstarted/devices/symbian/
- Sterling para WP7 – http://sterling.codeplex.com/
- Blog do Jeremy Likness – http://jeremylikness.com/
- Xte Profiler – http://xteprofiler.net/
- SilverMotion – http://postvision.net/SilverMotion/DemoTech.aspx
- Windows Phone 7 Tools Beta – http://developer.windowsphone.com/windows-phone-7/
Para assinar:
- Feed RSS: http://www.xamlcast.net
- iTunes/iPod: pcast://www.xamlcast.net
- Zune: zune://subscribe/?XAMLCast=http://www.xamlcast.net
O XAMLCast também está no Twitter!
- Twitter oficial: @xamlcast (e hashtag #xamlcast)
- Siga os XAMLCasters:
- Adicione o Twibbon do XAMLCast ao seu avatar!
Até o próximo!
Abraços,
Kelps, Roberto Sonnino e Rodrigo Kono
5 commentsCategories: .net, Dicas, Silverlight, XAMLCast
Surface Toolkit for Windows Touch Beta! 12/4/10
Hey there!
Today, together with the VS2010 launch, Microsoft has finally released the Surface Toolkit for Windows Touch for download!
But what is it, you might ask? This toolkit enables WPF developers with Windows 7 touch PCs with the Surface controls (such as ScatterView and Library) and touch visualizations to create really awesome multitouch apps.
Stop reading this and go download it now:
If you don’t have a touch device, you can use MultiTouchVista to simulate multiple touches using multiple mice. A step-by-step tutorial can be found in this link: http://wenjiun.blogspot.com/2009/11/testing-windows-7-multi-touch-with.html
Also take a look at this video from Channel 9 which shows the toolkit:
http://channel9.msdn.com/posts/LarryLarsen/Surface-Toolkit-for-Windows-Touch/
Happy multitouching!
Roberto
1 commentCategories: .net, Dicas, Microsoft, Novidades, Surface, This is Cool, WPF
Quick WPF/Silverlight tip: Generic Converter MarkupExtension 4/3/10
Hey there!
It’s been quite a while since the last English post – XAMLCast has been taking much of my blogging time
Today’s tip is an expansion of a method originally developed by Dr. WPF in this post: http://www.drwpf.com/blog/Home/tabid/36/EntryID/48/Default.aspx .
Usually, when working with Converters in WPF/SL, we always follow the same steps:
- Create a class that derives from IValueConverter:
public MyConverter : IValueConverter {} - Implement Convert (and sometimes ConvertBack)
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { // convert and return something } - Instantiate the converter as a resource and use it:
<ResourceDictionary ...> <local:MyConverter x:Key="TheConverter" /> </ResourceDictionary> ... {Binding Converter={StaticResource TheConverter} ...}
Well, it works but it’s not a compact syntax. Following Dr. WPF’s idea, we can use a MarkupExtension to replace the StaticResource by a static instance of the Converter:
public class MyConverter: MarkupExtension, IValueConverter
{
private static MyConverter _converter;
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// convert and return something
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// convert and return something (if needed)
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (_converter == null)
_converter = new MyConverter();
return _converter;
}
}
Usage:
xmlns:conv="[Path to namespace that contains the converter]"
...
{Binding Converter={conv:MyConverter}}
Now that’s pretty!
The only problem is that with this method, you’d have to repeat the implementation of the ProvideValue for each converter you create, and we programmers hate repeating ourselves
One solution I found is to create a generic abstract class that will contain that implementation, and derive each converter from that class. It’s cleaner and works the same:
using System;
using System.Windows.Data;
using System.Windows.Markup;
namespace VirtualDreams.Converters
{
[MarkupExtensionReturnType(typeof(IValueConverter))]
public abstract class ConverterMarkupExtension<T> : MarkupExtension where T : class, IValueConverter, new()
{
private static T _converter;
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (_converter == null)
{
_converter = new T();
}
return _converter;
}
}
}
Let’s apply it to MyConverter:
public class MyConverter: ConverterMarkupExtension<MyConverter>, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// convert and return something
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// convert and return something (if needed)
}
}
Usage:
xmlns:conv="[Path to namespace that contains the converter]"
...
{Binding Converter={conv:MyConverter}}
Simpler, less repetitive – that’s the way I like it!
Happy converting!
Roberto
This blog post is also available on CodeProject
Comment this postCategories: .net, Dicas, Silverlight, WPF
New article: Multi-touch development with WPF – A multi-touch RSS reader 1/11/09
Hey there!
I’ve just released a new article on CodeProject: this time it’s about multi-touch development with WPF 3.5 and Multi-Touch Vista. In the article you’ll learn how to set up your PC for multi-touch development and you’ll be able to see the making of a MT RSS reader application. If you’re interested in new interfaces and better user experiences, this article is a “must see” =D
Here’s the link:
http://www.codeproject.com/KB/WPF/MultiTouchRSS.aspx
If you like this article, please sign in and vote for this article (on the right corner, “Rate this article”). And please comment!
Also, if you like this kind of article, I’d recommend my other article on CodeProject, about 3D, speech and ink with WPF at http://www.codeproject.com/KB/WPF/3D-bookwriter.aspx .
Enjoy!
Thanks!
Roberto
Categories: .net, Artigos, Novidades, Surface, Tecnologia, WPF
Speech Recognition Engine in Portuguese (Brazil and Portugal) 30/10/09
Hey there,
After my original posts about speech recognition, I’ve been getting lots of questions about speech in other languages, especially Portuguese. At last I’ve got an answer for you: I’ve recently discovered some samples from Microsoft Portugal’s Language Development Center (MLDC) that provide Portuguese speech recognition engines!
These are the steps to get them:
- Take a look at the official MS Portugal site about this: http://www.microsoft.com/portugal/mldc/betaprograms/winclientdesktop.mspx
- Go to http://connect.microsoft.com and sign in
- Use this invitation ID: MLDC-BKBY-DTBD
- After filling in the survey, go to the Downloads page for this program: https://connect.microsoft.com/Downloads/Downloads.aspx?SiteID=368
- Download the packs and documentation and good luck!
Note: The language packs are from 2007; they haven’t been tested with Windows 7.
Note 2: The packs didn’t work in my English Windows 7. I guess you’ll need a Portuguese version of Windows Vista/7 to test them.
UPDATE 6/12: The pack DOES work, but only for custom apps. I might do a tutorial on this soon…
If it works for you please leave a comment!
Thanks and see you soon!
Roberto
Engine de Reconhecimento de Voz em Português (Brasil e Portugal)
Fala pessoal,

Após meus posts originais sobre reconhecimento de voz, eu tenho recebido muitas perguntas sobre Speech em outras línguas, especialmente português. Finalmente tenho uma resposta para vocês: recentemente eu descobri alguns samples do Language Development Center da Microsoft Portugal (MLDC) com engines de Speech em português!
Para baixar os packs, siga esses passos:
- Dê uma olhada no site oficial do MS Portugal sobre este assunto: http://www.microsoft.com/portugal/mldc/betaprograms/winclientdesktop.mspx
- Vá para http://connect.microsoft.com e faça login
- Use esse ID de convite: MLDC-BKBY-DTBD
- Depois de preencher a pesquisa, vá para a página de downloads para este programa: https://connect.microsoft.com/Downloads/Downloads.aspx?SiteID=368
- Baixe os pacotes e a documentação e a boa sorte!
Nota: Os pacotes são de 2007; eles ainda não foram testados com o Windows 7.
Nota 2: Os packs não funcionaram no meu Windows 7 em inglês. Talvez você precise de uma versão em português do Windows Vista/7 para testá-los.
UPDATE 6/12: O pack FUNCIONA, mas só.para programas desenvolvidos especialmente para ele. Talvez eu faça um tutorial sobre isso logo…
Se funcionar para você, por favor comente!
Obrigado e até a próxima!
Roberto
15 commentsCategories: .net, Dicas, Microsoft
Dica do dia, mês, ano! Sessões do MIX’08 online! 10/3/08
Fala pessoal!
A dica de hoje, quem acompanhou já sabia: hoje, todas as palestras do MIX’08 (TODAS!) estão disponíveis para ver online em Silverlight! (ou para download para MP4’s e afins)
É conteúdo de primeira! Centenas de palestras sobre UX, design, web, WPF, Silverlight, Surface… mais uma vez, não tem como não assistir!
Veja em http://sessions.visitmix.com/ .
Pretendo ver várias, mas por enquanto recomendo a BC01, sobre integração Blend+VS via snippets. Muito interessante! O código fonte da demo também está disponível.
http://sessions.visitmix.com/?selectedSearch=BC01
Além disso, curtam o belo site em SL, uma boa demonstração da tecnologia.
Abraços!
Roberto
Comment this postCategories: .net, Dicas, Expression, Microsoft, Novidades, Silverlight, Surface, This is Cool, WPF, Windows Live
WPF no MIX: Mais novidades chegando! 20/2/08
Fala pessoal!
A cada dia, novas surpresas da Microsoft para o WPF (e o .net)!
Hoje, o Scott Guthrie postou no seu blog algumas das novidades que estão chegando (e serão devidamente anunciadas no MIX). Entre elas, melhorias enormes de performance (25-40% no cold start), BitmapEffects por hardware no WPF, novas API’s de gráficos e dados, novos controles (incluindo o famoso DataGrid!), e mudanças no WPF designer!
Vamos aguardando! Leia o post completo em http://weblogs.asp.net/scottgu/archive/2008/02/19/net-3-5-client-product-roadmap.aspx
Abraço!
Roberto
Comment this postCategories: .net, Dicas, Microsoft, Novidades, WPF
Estamos de volta! 6/2/08
Fala pessoal!
Como vocês devem ter percebido, o Virtual Dreams e o XAMLCast ficaram de férias por aproximadamente um mês, e agora estamos voltando à rotina normal. Não vou nem me arriscar a tentar postar todas as novidades desse tempo que o blog ficou fora; vou trazer direto as mais novas!
Então vamos às dicas de hoje:
- Saiu no WindowsClient.net um paper sobre qualidade de aplicações em WPF. Ainda está bastante cru, mas já é uma informação valiosa. Acesse: WPF Application Quality Guide
- Se você acha que o Windows Vista copia arquivos muito lentamente, veja o backstage dessa história no blog do Mark Russinovich (MS), que explica tudo, como era e como é, e porque o Vista SP1 vai resolver isso de uma vez.
- Para quem quer participar da Imagine Cup, a dica: o Guerra publicou videos das apresentações do nosso projeto campeão da Imagine Cup 2007 (o e-du Box)! Veja: 1a apresentação | apresentação final (via AFurtado)
- Para quem quer se certificar nas novas tecnologias do .net (WPF, WCF, WF), estão disponíveis os exames beta (grátis!). Confira como na dica do Ramon
Por enquanto é isso. Aguardem mais em breve!
Abraço!
Roberto
Comment this postCategories: .net, Dicas, Imagine Cup, Microsoft, Novidades, WPF, Windows Vista
Dica: Usando reconhecimento de voz no Vista sem conflitar com o sistema operacional 27/12/07
Fala pessoal!
Hoje eu estava brincando um pouco com o Vista, e resolvi fuçar para ver se eu conseguia resolver um velho problema de todos os desenvolvedores de voz no Vista: quando você usa algum comando que conflita com o Windows Vista (ex. "close", ou "start"), o Windows sempre ganha, e a aplicação não executa o que você quer. E então, eu descobri a salvação: substitua o SpeechRecognizer por um SpeechRecognitionEngine!
Para demonstrar a dica, vou fazer um pequeno programa WPF. Crie um novo projeto WPF Windows, adicione referência para o namespace System.Speech (Project > Add Reference… > aba .NET), e adicione na janela principal um TextBlock:
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <TextBlock x:Name="resultado" Text="Nada, ainda"/> </Grid> </Window>
No código C#, adicione uma referência (using) para System.Speech.Recognition, e crie o SpeechRecognizer como sempre. Neste exemplo, vou usar palavras que conflitam com Vista, como "startmenu" e "close":
public partial class Window1 { public Window1() { InitializeComponent(); Loaded += Window1_Loaded; } protected object grammarLock = new object(); void Window1_Loaded(object sender, RoutedEventArgs e) { SpeechRecognizer _recognizer = new SpeechRecognizer(); _recognizer.SpeechRecognized += _recognizer_SpeechRecognized; lock (grammarLock) { _recognizer.UnloadAllGrammars(); _recognizer.LoadGrammar(new Grammar(new GrammarBuilder(new Choices("start menu", "close")))); } } void _recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { resultado.Text = e.Result.Text; } }
Rode a aplicação e tente falar "close", ou "start menu". O Vista vai pegar a prioridade sobre o comando, e sua janela irá fechar, ou o menu iniciar vai abrir. Como resolver isso? Você terá que trocar o SpeechRecognizer criado com a engine do Vista por um SpeechRecognitionEngine. Veja as mudanças:
void Window1_Loaded(object sender, RoutedEventArgs e) { SpeechRecognitionEngine _recognizer = new SpeechRecognitionEngine(); // mudei para SpeechRecognitionEngine _recognizer.SpeechRecognized += _recognizer_SpeechRecognized; _recognizer.SetInputToDefaultAudioDevice(); // adicionei essa linha para dizer que o som vem do microfone lock (grammarLock) { _recognizer.UnloadAllGrammars(); _recognizer.LoadGrammar(new Grammar(new GrammarBuilder(new Choices("start menu", "close")))); } _recognizer.RecognizeAsync(RecognizeMode.Multiple); // adicionei essa linha ativar o reconhecimento }
E pronto! Após essas mudanças, rode a aplicação e veja o resultado: quando você falar "close" e "start menu", eles aparecerão escritos na janela!
Problema resolvido! O único detalhe que você tem que ficar atento é que você perde a interface do Vista para voz, então fique de olho para fazer a sua interface ’substitutiva’ para manter uma experiência intuitiva para o usuário.
Você pode baixar o código dessa dica clicando no link abaixo:
Abraço!
Roberto
11 commentsCategories: .net, Dicas, WPF
XAMLCast no TechEd 2007 – Parte 2 – www.xamlcast.net 24/12/07
Fala pessoal!

Continuando a série de entrevistas que fizemos no TechEd 2007, hoje temos a entrevista com o MVP Bruno Sonnino que fez duas palestras (“WPF – Tudo que o Desenvolvedor precisa saber em 75 minutos”; “Visualização de dados com WPF”).
Experiência de desenvolvimento, dicas, Silverlight, 3D entre outros assuntos foram falados pelo Bruno. O áudio tem 30 min e está muito interessante. Vale a pena ouvir!
Seguem os links referenciais:
- Artigo sobre Databinding com LINQ baseado na palestra do TechEd (em inglês):
- Blog do Bruno Sonnino:
- Blog do Roberto Sonnino:
- Blog do Tim Sneath:
- Blog do Rob Relyea:
- Blog da Bea Costa:
Para assinar:
- Feed RSS: http://www.xamlcast.net
- iTunes/iPod: pcast://www.xamlcast.net
- Zune: zune://subscribe/?XAMLCast= http://www.xamlcast.net
Um Feliz Natal e Feliz 2008 para todos. O XAMLCast entra de férias agora e volta no meio de Janeiro.
Muitas realizações e muitas renderizações… =)
Abraço!
Roberto Sonnino e Rodrigo Kono
4 commentsCategories: .net, Dicas, Novidades, Silverlight, WPF, XAMLCast


